Version Description
- Fixed an issue when adding option to checkbox / radio / select field
- Fixed an issue with Custom Post Types loading (since WordPress 4.8.2)
Download this release
Release Info
Developer | christianglingener |
Plugin | Toolset Types – Custom Post Types, Custom Fields and Taxonomies |
Version | 2.2.18 |
Comparing to | |
See all releases |
Code changes from version 2.2.17 to 2.2.18
- application/autoload_classmap.php +2 -1
- application/controllers/ajax/handler/check_slug_conflicts.php +2 -1
- application/controllers/page/dashboard.php +3 -1
- application/controllers/page/extension/edit_post.php +2 -1
- application/controllers/utils/post_type_option.php +175 -0
- application/controllers/{utils.php → utils/utils.php} +0 -0
- readme.txt +5 -1
- vendor/autoload.php +1 -1
- vendor/composer/autoload_classmap.php +2 -1
- vendor/composer/autoload_real.php +7 -7
- vendor/composer/autoload_static.php +7 -6
- vendor/toolset/types/admin.php +4 -2
- vendor/toolset/types/embedded/classes/relationship/form-child.php +2 -1
- vendor/toolset/types/embedded/functions.php +8 -3
- vendor/toolset/types/embedded/includes/classes/class.types.data.installer.php +23 -3
- vendor/toolset/types/embedded/includes/custom-types.php +28 -15
- vendor/toolset/types/embedded/includes/import-export.php +2 -2
- vendor/toolset/types/embedded/includes/module-manager.php +8 -4
- vendor/toolset/types/embedded/includes/wpml.php +2 -1
- vendor/toolset/types/embedded/resources/js/basic.js +7 -5
- vendor/toolset/types/embedded/resources/js/custom-fields-form-filter.js +1 -1
- vendor/toolset/types/embedded/resources/js/fields-form.js +1 -1
- vendor/toolset/types/embedded/resources/js/fields-post.js +2 -2
- vendor/toolset/types/embedded/resources/js/post-relationship.js +2 -2
- vendor/toolset/types/embedded/resources/js/repetitive.js +1 -1
- vendor/toolset/types/includes/ajax.php +11 -6
- vendor/toolset/types/includes/classes/class.types.admin.edit.post.type.php +3 -37
- vendor/toolset/types/includes/classes/class.types.admin.edit.taxonomy.php +2 -1
- vendor/toolset/types/includes/classes/class.types.admin.page.php +3 -18
- vendor/toolset/types/includes/classes/class.types.admin.post-type.php +2 -2
- vendor/toolset/types/includes/classes/class.types.admin.post.types.list.table.php +3 -26
- vendor/toolset/types/includes/classes/class.types.admin.taxonomies.list.table.php +2 -1
- vendor/toolset/types/includes/classes/class.wpcf.marketing.messages.php +2 -2
- vendor/toolset/types/includes/classes/class.wpcf.roles.php +2 -1
- vendor/toolset/types/includes/custom-types-form.php +2 -1
- vendor/toolset/types/includes/custom-types-taxonomies-list.php +2 -1
- vendor/toolset/types/includes/import-export.php +2 -1
- vendor/toolset/types/includes/post-relationship.php +2 -1
- vendor/toolset/types/resources/js/collapsible.js +1 -1
- vendor/toolset/types/resources/js/fields-form.js +6 -4
- vendor/toolset/types/wpcf.php +2 -1
- wpcf.php +2 -2
application/autoload_classmap.php
CHANGED
@@ -133,7 +133,8 @@ return array(
|
|
133 |
'Types_Taxonomy' => dirname( __FILE__ ) . '/models/taxonomy.php',
|
134 |
'Types_Twig_Autoloader' => dirname( __FILE__ ) . '/controllers/twig_autoloader.php',
|
135 |
'Types_Upgrade' => dirname( __FILE__ ) . '/controllers/upgrade.php',
|
136 |
-
'Types_Utils' => dirname( __FILE__ ) . '/controllers/utils.php',
|
|
|
137 |
'Types_Wpml_Field_Group' => dirname( __FILE__ ) . '/models/wpml/field_group.php',
|
138 |
'Types_Wpml_Field_Group_String_Description' => dirname( __FILE__ ) . '/models/wpml/field/group/string/description.php',
|
139 |
'Types_Wpml_Field_Group_String' => dirname( __FILE__ ) . '/models/wpml/field/group/string.php',
|
133 |
'Types_Taxonomy' => dirname( __FILE__ ) . '/models/taxonomy.php',
|
134 |
'Types_Twig_Autoloader' => dirname( __FILE__ ) . '/controllers/twig_autoloader.php',
|
135 |
'Types_Upgrade' => dirname( __FILE__ ) . '/controllers/upgrade.php',
|
136 |
+
'Types_Utils' => dirname( __FILE__ ) . '/controllers/utils/utils.php',
|
137 |
+
'Types_Utils_Post_Type_Option' => dirname( __FILE__ ) . '/controllers/utils/post_type_option.php',
|
138 |
'Types_Wpml_Field_Group' => dirname( __FILE__ ) . '/models/wpml/field_group.php',
|
139 |
'Types_Wpml_Field_Group_String_Description' => dirname( __FILE__ ) . '/models/wpml/field/group/string/description.php',
|
140 |
'Types_Wpml_Field_Group_String' => dirname( __FILE__ ) . '/models/wpml/field/group/string.php',
|
application/controllers/ajax/handler/check_slug_conflicts.php
CHANGED
@@ -208,7 +208,8 @@ class Types_Ajax_Handler_Check_Slug_Conflicts extends Types_Ajax_Handler_Abstrac
|
|
208 |
|
209 |
// Merge currently registered post types (which might include some from other plugins) and
|
210 |
// Types settings (which might include deactivated post types).
|
211 |
-
$
|
|
|
212 |
if( !is_array( $post_type_settings ) ) {
|
213 |
return false;
|
214 |
}
|
208 |
|
209 |
// Merge currently registered post types (which might include some from other plugins) and
|
210 |
// Types settings (which might include deactivated post types).
|
211 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
212 |
+
$post_type_settings = $post_type_option->get_post_types();
|
213 |
if( !is_array( $post_type_settings ) ) {
|
214 |
return false;
|
215 |
}
|
application/controllers/page/dashboard.php
CHANGED
@@ -191,8 +191,10 @@ final class Types_Page_Dashboard extends Types_Page_Abstract {
|
|
191 |
if( $this->types_by_toolset !== null )
|
192 |
return $this->types_by_toolset;
|
193 |
|
|
|
|
|
194 |
$cpts_raw = ! isset( $_GET['toolset-dashboard-simulate-no-custom-post-types'] )
|
195 |
-
?
|
196 |
: array();
|
197 |
|
198 |
// remove buildin types
|
191 |
if( $this->types_by_toolset !== null )
|
192 |
return $this->types_by_toolset;
|
193 |
|
194 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
195 |
+
|
196 |
$cpts_raw = ! isset( $_GET['toolset-dashboard-simulate-no-custom-post-types'] )
|
197 |
+
? $post_type_option->get_post_types()
|
198 |
: array();
|
199 |
|
200 |
// remove buildin types
|
application/controllers/page/extension/edit_post.php
CHANGED
@@ -22,7 +22,8 @@ final class Types_Page_Extension_Edit_Post {
|
|
22 |
|
23 |
// if no post or no page
|
24 |
if( $post_type != 'post' && $post_type != 'page' ) {
|
25 |
-
$
|
|
|
26 |
|
27 |
// abort if also no custom post type of types
|
28 |
if( ! array_key_exists( $post_type, $custom_types ) )
|
22 |
|
23 |
// if no post or no page
|
24 |
if( $post_type != 'post' && $post_type != 'page' ) {
|
25 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
26 |
+
$custom_types = $post_type_option->get_post_types();
|
27 |
|
28 |
// abort if also no custom post type of types
|
29 |
if( ! array_key_exists( $post_type, $custom_types ) )
|
application/controllers/utils/post_type_option.php
ADDED
@@ -0,0 +1,175 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Provides a safer access to the option with post type values.
|
5 |
+
*
|
6 |
+
* If the option value is a standard serialized array, the performance is negligible. However, if the option is
|
7 |
+
* malformed by some sort of search-replace in string values (stored string length doesn't match the actual one),
|
8 |
+
* it will try to salvage the situation without the user even noticing.
|
9 |
+
*
|
10 |
+
* It specifically fixes on focusing a bug caused by WordPress 4.8.3 where in a certain situation the post type labels,
|
11 |
+
* which contain the %s placeholder, are damaged by replacing the '%' character by another placeholder (see
|
12 |
+
* https://make.wordpress.org/core/2017/10/31/changed-behaviour-of-esc_sql-in-wordpress-4-8-3/ for details).
|
13 |
+
*
|
14 |
+
* If the option needs to be fixed, we will further try to detect these placeholders in post type labels
|
15 |
+
* and replace them with '%s'. It is very unlikely that someone would save a value like '{18184a8b66ef}s' inside
|
16 |
+
* the label AND that the option becomes malformed at the same time, so we take the risk and replace it with '%s'.
|
17 |
+
*
|
18 |
+
* In order to be able to do this, we need to access the wp_options table directly, because get_option() calls
|
19 |
+
* unserialize() before a filter we could reasonably hook into, and at that point we already get just a 'false' value.
|
20 |
+
*
|
21 |
+
* As a consequence, all occurences of "get_option( WPCF_OPTION_NAME_CUSTOM_TYPES, array() )" must be replaced
|
22 |
+
* by a call to Types_Utils_Post_Type_Option::get_post_types().
|
23 |
+
*
|
24 |
+
* The solution is inspired by https://github.com/Blogestudio/Fix-Serialization/blob/master/fix-serialization.php
|
25 |
+
*
|
26 |
+
* IMPORTANT: Beware that this class is being manually loaded even before Toolset Common in some cases. Do not move it
|
27 |
+
* without considering that and do not use anything fancy like toolset_ensarr() here.
|
28 |
+
*
|
29 |
+
* @since 2.2.18
|
30 |
+
*/
|
31 |
+
class Types_Utils_Post_Type_Option {
|
32 |
+
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Get the post types option.
|
36 |
+
*
|
37 |
+
* @return array
|
38 |
+
*/
|
39 |
+
public function get_post_types() {
|
40 |
+
$post_types = get_option( WPCF_OPTION_NAME_CUSTOM_TYPES, array() );
|
41 |
+
|
42 |
+
if ( ! is_array( $post_types ) ) {
|
43 |
+
$raw_value = $this->get_raw_option();
|
44 |
+
if ( is_string( $raw_value ) && ! empty( $raw_value ) ) {
|
45 |
+
// Now we know that something went seriously wrong AND we probably have post types to save.
|
46 |
+
$post_types = $this->try_fix_serialized_array( $raw_value );
|
47 |
+
$post_types = maybe_unserialize( $post_types );
|
48 |
+
$post_types = $this->try_fix_post_type_labels( $post_types );
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
+
if ( ! is_array( $post_types ) ) {
|
53 |
+
return array();
|
54 |
+
}
|
55 |
+
|
56 |
+
return $post_types;
|
57 |
+
}
|
58 |
+
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Get the raw WPCF_OPTION_NAME_CUSTOM_TYPES option from the database.
|
62 |
+
*
|
63 |
+
* @return null|string
|
64 |
+
*/
|
65 |
+
private function get_raw_option() {
|
66 |
+
global $wpdb;
|
67 |
+
|
68 |
+
$option_value = $wpdb->get_var(
|
69 |
+
$wpdb->prepare(
|
70 |
+
"SELECT option_value FROM {$wpdb->options} WHERE option_name = %s",
|
71 |
+
WPCF_OPTION_NAME_CUSTOM_TYPES
|
72 |
+
)
|
73 |
+
);
|
74 |
+
|
75 |
+
return $option_value;
|
76 |
+
}
|
77 |
+
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Restore a broken serialized array by fixing string lengths.
|
81 |
+
*
|
82 |
+
* @param $broken_serialized_array
|
83 |
+
* @return string
|
84 |
+
*/
|
85 |
+
private function try_fix_serialized_array( $broken_serialized_array ) {
|
86 |
+
$output = preg_replace_callback(
|
87 |
+
'!s:(\d+):([\\\\]?"[\\\\]?"|[\\\\]?"((.*?)[^\\\\])[\\\\]?");!',
|
88 |
+
array( $this, 'preg_replace_callback' ),
|
89 |
+
$broken_serialized_array
|
90 |
+
);
|
91 |
+
|
92 |
+
return $output;
|
93 |
+
}
|
94 |
+
|
95 |
+
|
96 |
+
/**
|
97 |
+
* Fix a string length for a single occurence.
|
98 |
+
*
|
99 |
+
* @param array $matches
|
100 |
+
* @return string
|
101 |
+
*/
|
102 |
+
private function preg_replace_callback( $matches ) {
|
103 |
+
if ( count( $matches ) < 4 ) {
|
104 |
+
// empty string
|
105 |
+
return $matches[0];
|
106 |
+
}
|
107 |
+
|
108 |
+
$stored_string = $matches[3];
|
109 |
+
$string_mysql_unescaped = $this->unescape_mysql( $stored_string );
|
110 |
+
$string_length = strlen( $string_mysql_unescaped );
|
111 |
+
$string_without_quotes = $this->unescape_quotes( $stored_string );
|
112 |
+
|
113 |
+
$replacement = 's:' . $string_length . ':"' . $string_without_quotes . '";';
|
114 |
+
|
115 |
+
return $replacement;
|
116 |
+
}
|
117 |
+
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Update the post types option
|
121 |
+
* @param $post_types
|
122 |
+
*/
|
123 |
+
public function update_post_types( $post_types ) {
|
124 |
+
update_option( WPCF_OPTION_NAME_CUSTOM_TYPES, $post_types, true );
|
125 |
+
}
|
126 |
+
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Unescape to avoid dump-text issues.
|
130 |
+
*
|
131 |
+
* @param string $value
|
132 |
+
* @return string
|
133 |
+
*/
|
134 |
+
private function unescape_mysql( $value ) {
|
135 |
+
return str_replace(
|
136 |
+
array( "\\\\", "\\0", "\\n", "\\r", "\Z", "\'", '\"' ),
|
137 |
+
array( "\\", "\0", "\n", "\r", "\x1a", "'", '"' ),
|
138 |
+
$value
|
139 |
+
);
|
140 |
+
}
|
141 |
+
|
142 |
+
|
143 |
+
/**
|
144 |
+
* Fix strange behaviour if you have escaped quotes in your replacement
|
145 |
+
*
|
146 |
+
* @param string $value
|
147 |
+
*
|
148 |
+
* @return string
|
149 |
+
*/
|
150 |
+
private function unescape_quotes( $value ) {
|
151 |
+
return str_replace( '\"', '"', $value );
|
152 |
+
}
|
153 |
+
|
154 |
+
|
155 |
+
/**
|
156 |
+
* @param array $post_types
|
157 |
+
* @return array
|
158 |
+
*/
|
159 |
+
private function try_fix_post_type_labels( $post_types ) {
|
160 |
+
foreach ( $post_types as $key => $post_type ) {
|
161 |
+
if ( ! array_key_exists( 'labels', $post_type ) ) {
|
162 |
+
continue;
|
163 |
+
}
|
164 |
+
|
165 |
+
foreach ( $post_type['labels'] as $label_name => $label_value ) {
|
166 |
+
$fixed_label = preg_replace( '/\{[a-f0-9]{8,}\}s/', '%s', $label_value );
|
167 |
+
$post_types[ $key ]['labels'][ $label_name ] = $fixed_label;
|
168 |
+
}
|
169 |
+
}
|
170 |
+
|
171 |
+
return $post_types;
|
172 |
+
}
|
173 |
+
|
174 |
+
}
|
175 |
+
|
application/controllers/{utils.php → utils/utils.php}
RENAMED
File without changes
|
readme.txt
CHANGED
@@ -7,7 +7,7 @@ Domain Path: /embedded/locale
|
|
7 |
License: GPLv2
|
8 |
Requires at least: 3.7
|
9 |
Tested up to: 4.8.1
|
10 |
-
Stable tag: 2.2.
|
11 |
|
12 |
The complete and reliable plugin for managing custom post types, custom taxonomies and custom fields.
|
13 |
|
@@ -158,6 +158,10 @@ Additionally, Types is the only plugin that lets you define parent/child relatio
|
|
158 |
|
159 |
== Changelog ==
|
160 |
|
|
|
|
|
|
|
|
|
161 |
= 2.2.17 =
|
162 |
* Fixed an issue when saving field conditional while the latest version of Views was active.
|
163 |
* Updated the list of WordPress reserved names.
|
7 |
License: GPLv2
|
8 |
Requires at least: 3.7
|
9 |
Tested up to: 4.8.1
|
10 |
+
Stable tag: 2.2.18
|
11 |
|
12 |
The complete and reliable plugin for managing custom post types, custom taxonomies and custom fields.
|
13 |
|
158 |
|
159 |
== Changelog ==
|
160 |
|
161 |
+
= 2.2.18 =
|
162 |
+
* Fixed an issue when adding option to checkbox / radio / select field
|
163 |
+
* Fixed an issue with Custom Post Types loading (since WordPress 4.8.2)
|
164 |
+
|
165 |
= 2.2.17 =
|
166 |
* Fixed an issue when saving field conditional while the latest version of Views was active.
|
167 |
* Updated the list of WordPress reserved names.
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit02ae3ccb850d178bd58e2f427ca06b9a::getLoader();
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -649,7 +649,8 @@ return array(
|
|
649 |
'Types_Taxonomy' => $baseDir . '/application/models/taxonomy.php',
|
650 |
'Types_Twig_Autoloader' => $baseDir . '/application/controllers/twig_autoloader.php',
|
651 |
'Types_Upgrade' => $baseDir . '/application/controllers/upgrade.php',
|
652 |
-
'Types_Utils' => $baseDir . '/application/controllers/utils.php',
|
|
|
653 |
'Types_Wpml_Field_Group' => $baseDir . '/application/models/wpml/field_group.php',
|
654 |
'Types_Wpml_Field_Group_String' => $baseDir . '/application/models/wpml/field/group/string.php',
|
655 |
'Types_Wpml_Field_Group_String_Description' => $baseDir . '/application/models/wpml/field/group/string/description.php',
|
649 |
'Types_Taxonomy' => $baseDir . '/application/models/taxonomy.php',
|
650 |
'Types_Twig_Autoloader' => $baseDir . '/application/controllers/twig_autoloader.php',
|
651 |
'Types_Upgrade' => $baseDir . '/application/controllers/upgrade.php',
|
652 |
+
'Types_Utils' => $baseDir . '/application/controllers/utils/utils.php',
|
653 |
+
'Types_Utils_Post_Type_Option' => $baseDir . '/application/controllers/utils/post_type_option.php',
|
654 |
'Types_Wpml_Field_Group' => $baseDir . '/application/models/wpml/field_group.php',
|
655 |
'Types_Wpml_Field_Group_String' => $baseDir . '/application/models/wpml/field/group/string.php',
|
656 |
'Types_Wpml_Field_Group_String_Description' => $baseDir . '/application/models/wpml/field/group/string/description.php',
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit6a97a89ade699b56766115f79e4e4f36
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
-
call_user_func(\Composer\Autoload\
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
@@ -48,19 +48,19 @@ class ComposerAutoloaderInit6a97a89ade699b56766115f79e4e4f36
|
|
48 |
$loader->register(true);
|
49 |
|
50 |
if ($useStaticLoader) {
|
51 |
-
$includeFiles = Composer\Autoload\
|
52 |
} else {
|
53 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
54 |
}
|
55 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
56 |
-
|
57 |
}
|
58 |
|
59 |
return $loader;
|
60 |
}
|
61 |
}
|
62 |
|
63 |
-
function
|
64 |
{
|
65 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
66 |
require $file;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit02ae3ccb850d178bd58e2f427ca06b9a
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit02ae3ccb850d178bd58e2f427ca06b9a', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit02ae3ccb850d178bd58e2f427ca06b9a', 'loadClassLoader'));
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit02ae3ccb850d178bd58e2f427ca06b9a::getInitializer($loader));
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
48 |
$loader->register(true);
|
49 |
|
50 |
if ($useStaticLoader) {
|
51 |
+
$includeFiles = Composer\Autoload\ComposerStaticInit02ae3ccb850d178bd58e2f427ca06b9a::$files;
|
52 |
} else {
|
53 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
54 |
}
|
55 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
56 |
+
composerRequire02ae3ccb850d178bd58e2f427ca06b9a($fileIdentifier, $file);
|
57 |
}
|
58 |
|
59 |
return $loader;
|
60 |
}
|
61 |
}
|
62 |
|
63 |
+
function composerRequire02ae3ccb850d178bd58e2f427ca06b9a($fileIdentifier, $file)
|
64 |
{
|
65 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
66 |
require $file;
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'a52c1eba913b4ecdd3571194b37baea9' => __DIR__ . '/../..' . '/application/functions.php',
|
@@ -678,7 +678,8 @@ class ComposerStaticInit6a97a89ade699b56766115f79e4e4f36
|
|
678 |
'Types_Taxonomy' => __DIR__ . '/../..' . '/application/models/taxonomy.php',
|
679 |
'Types_Twig_Autoloader' => __DIR__ . '/../..' . '/application/controllers/twig_autoloader.php',
|
680 |
'Types_Upgrade' => __DIR__ . '/../..' . '/application/controllers/upgrade.php',
|
681 |
-
'Types_Utils' => __DIR__ . '/../..' . '/application/controllers/utils.php',
|
|
|
682 |
'Types_Wpml_Field_Group' => __DIR__ . '/../..' . '/application/models/wpml/field_group.php',
|
683 |
'Types_Wpml_Field_Group_String' => __DIR__ . '/../..' . '/application/models/wpml/field/group/string.php',
|
684 |
'Types_Wpml_Field_Group_String_Description' => __DIR__ . '/../..' . '/application/models/wpml/field/group/string/description.php',
|
@@ -726,10 +727,10 @@ class ComposerStaticInit6a97a89ade699b56766115f79e4e4f36
|
|
726 |
public static function getInitializer(ClassLoader $loader)
|
727 |
{
|
728 |
return \Closure::bind(function () use ($loader) {
|
729 |
-
$loader->prefixLengthsPsr4 =
|
730 |
-
$loader->prefixDirsPsr4 =
|
731 |
-
$loader->prefixesPsr0 =
|
732 |
-
$loader->classMap =
|
733 |
|
734 |
}, null, ClassLoader::class);
|
735 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit02ae3ccb850d178bd58e2f427ca06b9a
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'a52c1eba913b4ecdd3571194b37baea9' => __DIR__ . '/../..' . '/application/functions.php',
|
678 |
'Types_Taxonomy' => __DIR__ . '/../..' . '/application/models/taxonomy.php',
|
679 |
'Types_Twig_Autoloader' => __DIR__ . '/../..' . '/application/controllers/twig_autoloader.php',
|
680 |
'Types_Upgrade' => __DIR__ . '/../..' . '/application/controllers/upgrade.php',
|
681 |
+
'Types_Utils' => __DIR__ . '/../..' . '/application/controllers/utils/utils.php',
|
682 |
+
'Types_Utils_Post_Type_Option' => __DIR__ . '/../..' . '/application/controllers/utils/post_type_option.php',
|
683 |
'Types_Wpml_Field_Group' => __DIR__ . '/../..' . '/application/models/wpml/field_group.php',
|
684 |
'Types_Wpml_Field_Group_String' => __DIR__ . '/../..' . '/application/models/wpml/field/group/string.php',
|
685 |
'Types_Wpml_Field_Group_String_Description' => __DIR__ . '/../..' . '/application/models/wpml/field/group/string/description.php',
|
727 |
public static function getInitializer(ClassLoader $loader)
|
728 |
{
|
729 |
return \Closure::bind(function () use ($loader) {
|
730 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit02ae3ccb850d178bd58e2f427ca06b9a::$prefixLengthsPsr4;
|
731 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit02ae3ccb850d178bd58e2f427ca06b9a::$prefixDirsPsr4;
|
732 |
+
$loader->prefixesPsr0 = ComposerStaticInit02ae3ccb850d178bd58e2f427ca06b9a::$prefixesPsr0;
|
733 |
+
$loader->classMap = ComposerStaticInit02ae3ccb850d178bd58e2f427ca06b9a::$classMap;
|
734 |
|
735 |
}, null, ClassLoader::class);
|
736 |
}
|
vendor/toolset/types/admin.php
CHANGED
@@ -570,7 +570,8 @@ function wpcf_admin_menu_summary_cpt()
|
|
570 |
array('page'=>'wpcf-edit-type'),
|
571 |
__('Add New', 'wpcf')
|
572 |
);
|
573 |
-
|
|
|
574 |
$to_display_tax = get_option( WPCF_OPTION_NAME_CUSTOM_TAXONOMIES, array() );
|
575 |
if ( !empty( $to_display_posts ) || !empty( $to_display_tax ) ) {
|
576 |
add_action( 'wpcf_types_tax_list_table_after', 'wpcf_admin_promotional_text' );
|
@@ -1670,7 +1671,8 @@ function wpcf_admin_deactivate_content($type, $arg, $action = 'delete')
|
|
1670 |
case 'taxonomy':
|
1671 |
// Clean post relations
|
1672 |
if ( $action == 'delete' ) {
|
1673 |
-
|
|
|
1674 |
foreach ( $custom as $post_type => $data ) {
|
1675 |
if ( empty( $data['taxonomies'] ) ) {
|
1676 |
continue;
|
570 |
array('page'=>'wpcf-edit-type'),
|
571 |
__('Add New', 'wpcf')
|
572 |
);
|
573 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
574 |
+
$to_display_posts = $post_type_option->get_post_types();
|
575 |
$to_display_tax = get_option( WPCF_OPTION_NAME_CUSTOM_TAXONOMIES, array() );
|
576 |
if ( !empty( $to_display_posts ) || !empty( $to_display_tax ) ) {
|
577 |
add_action( 'wpcf_types_tax_list_table_after', 'wpcf_admin_promotional_text' );
|
1671 |
case 'taxonomy':
|
1672 |
// Clean post relations
|
1673 |
if ( $action == 'delete' ) {
|
1674 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
1675 |
+
$custom = $post_type_option->get_post_types();
|
1676 |
foreach ( $custom as $post_type => $data ) {
|
1677 |
if ( empty( $data['taxonomies'] ) ) {
|
1678 |
continue;
|
vendor/toolset/types/embedded/classes/relationship/form-child.php
CHANGED
@@ -122,7 +122,8 @@ class WPCF_Relationship_Child_Form
|
|
122 |
/**
|
123 |
* post types managed by Types
|
124 |
*/
|
125 |
-
|
|
|
126 |
if (
|
127 |
array_key_exists($child_post_type, $post_types )
|
128 |
&& array_key_exists('supports', $post_types[$child_post_type] )
|
122 |
/**
|
123 |
* post types managed by Types
|
124 |
*/
|
125 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
126 |
+
$post_types = $post_type_option->get_post_types();
|
127 |
if (
|
128 |
array_key_exists($child_post_type, $post_types )
|
129 |
&& array_key_exists('supports', $post_types[$child_post_type] )
|
vendor/toolset/types/embedded/functions.php
CHANGED
@@ -64,7 +64,10 @@ function wpcf_get_file_relpath($file)
|
|
64 |
*/
|
65 |
function wpcf_embedded_after_setup_theme_hook()
|
66 |
{
|
67 |
-
|
|
|
|
|
|
|
68 |
if ( !empty( $custom_types ) ) {
|
69 |
foreach ( $custom_types as $post_type => $data ) {
|
70 |
if ( !empty( $data['supports']['thumbnail'] ) ) {
|
@@ -98,7 +101,8 @@ function wpcf_init_custom_types_taxonomies()
|
|
98 |
}
|
99 |
|
100 |
// register post types
|
101 |
-
|
|
|
102 |
if ( !empty( $custom_types ) ) {
|
103 |
require_once WPCF_EMBEDDED_INC_ABSPATH . '/custom-types.php';
|
104 |
wpcf_custom_types_init();
|
@@ -672,7 +676,8 @@ function wpcf_is_embedded()
|
|
672 |
*/
|
673 |
function wpcf_get_custom_post_type_settings($item = '')
|
674 |
{
|
675 |
-
|
|
|
676 |
return !empty( $custom[$item] ) ? $custom[$item] : array();
|
677 |
}
|
678 |
|
64 |
*/
|
65 |
function wpcf_embedded_after_setup_theme_hook()
|
66 |
{
|
67 |
+
// We need to require this file manually because this runs before the autoloader is registered.
|
68 |
+
require_once TYPES_ABSPATH . '/application/controllers/utils/post_type_option.php';
|
69 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
70 |
+
$custom_types = $post_type_option->get_post_types();
|
71 |
if ( !empty( $custom_types ) ) {
|
72 |
foreach ( $custom_types as $post_type => $data ) {
|
73 |
if ( !empty( $data['supports']['thumbnail'] ) ) {
|
101 |
}
|
102 |
|
103 |
// register post types
|
104 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
105 |
+
$custom_types = $post_type_option->get_post_types();
|
106 |
if ( !empty( $custom_types ) ) {
|
107 |
require_once WPCF_EMBEDDED_INC_ABSPATH . '/custom-types.php';
|
108 |
wpcf_custom_types_init();
|
676 |
*/
|
677 |
function wpcf_get_custom_post_type_settings($item = '')
|
678 |
{
|
679 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
680 |
+
$custom = $post_type_option->get_post_types();
|
681 |
return !empty( $custom[$item] ) ? $custom[$item] : array();
|
682 |
}
|
683 |
|
vendor/toolset/types/embedded/includes/classes/class.types.data.installer.php
CHANGED
@@ -193,9 +193,14 @@ if ( !class_exists('Types_Data_Installer') ) {
|
|
193 |
|
194 |
$this->reset_toolset_edit_last_list[$group_name] = array();
|
195 |
|
196 |
-
$date = date('Y-m-d H:i');
|
197 |
$new = array();
|
198 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
|
200 |
foreach ( $groups as $group) {
|
201 |
$slug = $group->slug->__toString();
|
@@ -248,8 +253,23 @@ if ( !class_exists('Types_Data_Installer') ) {
|
|
248 |
}
|
249 |
break;
|
250 |
case WPCF_OPTION_NAME_CUSTOM_TYPES:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
case WPCF_OPTION_NAME_CUSTOM_TAXONOMIES:
|
252 |
-
$options = get_option(
|
253 |
$new = array();
|
254 |
foreach ( $options as $one ) {
|
255 |
if ( in_array($one['slug'], $data ) ) {
|
193 |
|
194 |
$this->reset_toolset_edit_last_list[$group_name] = array();
|
195 |
|
|
|
196 |
$new = array();
|
197 |
+
|
198 |
+
if( WPCF_OPTION_NAME_CUSTOM_TYPES === $group_name ) {
|
199 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
200 |
+
$data = $post_type_option->get_post_types();
|
201 |
+
} else {
|
202 |
+
$data = get_option( $group_name, array() );
|
203 |
+
}
|
204 |
|
205 |
foreach ( $groups as $group) {
|
206 |
$slug = $group->slug->__toString();
|
253 |
}
|
254 |
break;
|
255 |
case WPCF_OPTION_NAME_CUSTOM_TYPES:
|
256 |
+
|
257 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
258 |
+
$options = $post_type_option->get_post_types();
|
259 |
+
$new = array();
|
260 |
+
foreach ( $options as $one ) {
|
261 |
+
if ( in_array($one['slug'], $data ) ) {
|
262 |
+
if ( isset( $one[TOOLSET_EDIT_LAST]) ) {
|
263 |
+
unset($one[TOOLSET_EDIT_LAST]);
|
264 |
+
}
|
265 |
+
}
|
266 |
+
$new[$one['slug']] = $one;
|
267 |
+
}
|
268 |
+
update_option($group, $new);
|
269 |
+
break;
|
270 |
+
|
271 |
case WPCF_OPTION_NAME_CUSTOM_TAXONOMIES:
|
272 |
+
$options = get_option( WPCF_OPTION_NAME_CUSTOM_TAXONOMIES, array() );
|
273 |
$new = array();
|
274 |
foreach ( $options as $one ) {
|
275 |
if ( in_array($one['slug'], $data ) ) {
|
vendor/toolset/types/embedded/includes/custom-types.php
CHANGED
@@ -84,7 +84,8 @@ function wpcf_custom_types_default() {
|
|
84 |
* Inits custom types.
|
85 |
*/
|
86 |
function wpcf_custom_types_init() {
|
87 |
-
|
|
|
88 |
if ( !empty( $custom_types ) ) {
|
89 |
foreach ( $custom_types as $post_type => $data ) {
|
90 |
if ( empty($data) ) {
|
@@ -110,7 +111,8 @@ function wpcf_custom_types_init() {
|
|
110 |
}
|
111 |
|
112 |
function types_menu_order( $menu ) {
|
113 |
-
$
|
|
|
114 |
|
115 |
if ( !empty( $custom_types ) ) {
|
116 |
foreach( $custom_types as $post_type => $data ) {
|
@@ -454,21 +456,27 @@ function wpcf_filter_type( $data, $post_type ) {
|
|
454 |
return $data;
|
455 |
}
|
456 |
|
|
|
457 |
/**
|
458 |
* Returns active post types.
|
459 |
*
|
460 |
-
* @return
|
|
|
|
|
461 |
*/
|
462 |
function wpcf_get_active_custom_types() {
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
|
|
|
|
470 |
}
|
471 |
|
|
|
472 |
/** This action is documented in wp-admin/includes/table.php */
|
473 |
add_filter('dashboard_glance_items', 'wpcf_dashboard_glance_items');
|
474 |
|
@@ -487,7 +495,8 @@ function wpcf_dashboard_glance_items($elements)
|
|
487 |
wp_register_style( 'wpcf-fix-wordpress-core', WPCF_EMBEDDED_RES_RELPATH . '/css/fix-wordpress-core.css', array(), WPCF_VERSION );
|
488 |
wp_enqueue_style( 'wpcf-fix-wordpress-core' );
|
489 |
|
490 |
-
|
|
|
491 |
if ( empty( $custom_types ) ) {
|
492 |
return $elements;
|
493 |
}
|
@@ -548,7 +557,8 @@ function wpcf_dashboard_glance_items($elements)
|
|
548 |
function wpcf_filter_enter_title_here($enter_title_here, $post)
|
549 |
{
|
550 |
if ( is_object($post) && isset( $post->post_type) ) {
|
551 |
-
|
|
|
552 |
if (
|
553 |
true
|
554 |
&& isset($custom_types[$post->post_type])
|
@@ -592,7 +602,8 @@ function types_get_array_key_search_in_sub( $array, $search ) {
|
|
592 |
*/
|
593 |
function types_rename_build_in_post_types_menu() {
|
594 |
|
595 |
-
|
|
|
596 |
|
597 |
if ( !empty( $custom_types ) ) {
|
598 |
global $menu, $submenu;
|
@@ -665,7 +676,8 @@ add_action( 'admin_menu', 'types_rename_build_in_post_types_menu' );
|
|
665 |
*/
|
666 |
function types_rename_build_in_post_types() {
|
667 |
global $wp_post_types;
|
668 |
-
|
|
|
669 |
|
670 |
if ( !empty( $custom_types ) ) {
|
671 |
foreach ( $custom_types as $post_type => $data ) {
|
@@ -714,7 +726,8 @@ add_action( 'init', 'types_rename_build_in_post_types' );
|
|
714 |
* Visibility of inbuild types
|
715 |
*/
|
716 |
function types_visibility_build_in_types() {
|
717 |
-
|
|
|
718 |
|
719 |
// Type: Posts
|
720 |
if( isset( $custom_types['post']['public'] )
|
84 |
* Inits custom types.
|
85 |
*/
|
86 |
function wpcf_custom_types_init() {
|
87 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
88 |
+
$custom_types = $post_type_option->get_post_types();
|
89 |
if ( !empty( $custom_types ) ) {
|
90 |
foreach ( $custom_types as $post_type => $data ) {
|
91 |
if ( empty($data) ) {
|
111 |
}
|
112 |
|
113 |
function types_menu_order( $menu ) {
|
114 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
115 |
+
$custom_types = $post_type_option->get_post_types();
|
116 |
|
117 |
if ( !empty( $custom_types ) ) {
|
118 |
foreach( $custom_types as $post_type => $data ) {
|
456 |
return $data;
|
457 |
}
|
458 |
|
459 |
+
|
460 |
/**
|
461 |
* Returns active post types.
|
462 |
*
|
463 |
+
* @return array
|
464 |
+
* @deprecated Use the Post Type API instead: https://git.onthegosystems.com/toolset/toolset-common/wikis/post-type-api
|
465 |
+
* @since unknown
|
466 |
*/
|
467 |
function wpcf_get_active_custom_types() {
|
468 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
469 |
+
$types = $post_type_option->get_post_types();
|
470 |
+
foreach ( $types as $type => $data ) {
|
471 |
+
if ( ! empty( $data['disabled'] ) ) {
|
472 |
+
unset( $types[ $type ] );
|
473 |
+
}
|
474 |
+
}
|
475 |
+
|
476 |
+
return $types;
|
477 |
}
|
478 |
|
479 |
+
|
480 |
/** This action is documented in wp-admin/includes/table.php */
|
481 |
add_filter('dashboard_glance_items', 'wpcf_dashboard_glance_items');
|
482 |
|
495 |
wp_register_style( 'wpcf-fix-wordpress-core', WPCF_EMBEDDED_RES_RELPATH . '/css/fix-wordpress-core.css', array(), WPCF_VERSION );
|
496 |
wp_enqueue_style( 'wpcf-fix-wordpress-core' );
|
497 |
|
498 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
499 |
+
$custom_types = $post_type_option->get_post_types();
|
500 |
if ( empty( $custom_types ) ) {
|
501 |
return $elements;
|
502 |
}
|
557 |
function wpcf_filter_enter_title_here($enter_title_here, $post)
|
558 |
{
|
559 |
if ( is_object($post) && isset( $post->post_type) ) {
|
560 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
561 |
+
$custom_types = $post_type_option->get_post_types();
|
562 |
if (
|
563 |
true
|
564 |
&& isset($custom_types[$post->post_type])
|
602 |
*/
|
603 |
function types_rename_build_in_post_types_menu() {
|
604 |
|
605 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
606 |
+
$custom_types = $post_type_option->get_post_types();
|
607 |
|
608 |
if ( !empty( $custom_types ) ) {
|
609 |
global $menu, $submenu;
|
676 |
*/
|
677 |
function types_rename_build_in_post_types() {
|
678 |
global $wp_post_types;
|
679 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
680 |
+
$custom_types = $post_type_option->get_post_types();
|
681 |
|
682 |
if ( !empty( $custom_types ) ) {
|
683 |
foreach ( $custom_types as $post_type => $data ) {
|
726 |
* Visibility of inbuild types
|
727 |
*/
|
728 |
function types_visibility_build_in_types() {
|
729 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
730 |
+
$custom_types = $post_type_option->get_post_types();
|
731 |
|
732 |
// Type: Posts
|
733 |
if( isset( $custom_types['post']['public'] )
|
vendor/toolset/types/embedded/includes/import-export.php
CHANGED
@@ -738,8 +738,8 @@ function wpcf_admin_import_data( $data = '', $redirect = true, $context = 'types
|
|
738 |
$return = array_merge( $return, $term_group_results, $term_field_results );
|
739 |
|
740 |
// Process types
|
741 |
-
|
742 |
-
$types_existing =
|
743 |
$types_check = array();
|
744 |
if ( ! empty( $data->types ) && isset( $data->types->type ) ) {
|
745 |
$types = array();
|
738 |
$return = array_merge( $return, $term_group_results, $term_field_results );
|
739 |
|
740 |
// Process types
|
741 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
742 |
+
$types_existing = $post_type_option->get_post_types();
|
743 |
$types_check = array();
|
744 |
if ( ! empty( $data->types ) && isset( $data->types->type ) ) {
|
745 |
$types = array();
|
vendor/toolset/types/embedded/includes/module-manager.php
CHANGED
@@ -133,7 +133,8 @@ function wpcf_admin_metabox_module_manager($type)
|
|
133 |
function wpcf_module_inline_table_post_types() {
|
134 |
// dont add module manager meta box on new post type form
|
135 |
if ( defined( 'MODMAN_PLUGIN_NAME' ) && isset( $_GET['wpcf-post-type'] ) ) {
|
136 |
-
|
|
|
137 |
if ( isset( $_custom_types[$_GET['wpcf-post-type']] ) ) {
|
138 |
$_post_type = $_custom_types[$_GET['wpcf-post-type']];
|
139 |
// add module manager meta box to post type form
|
@@ -249,7 +250,8 @@ if ( defined( 'MODMAN_PLUGIN_NAME' ) ) {
|
|
249 |
}
|
250 |
|
251 |
function wpcf_register_modules_items_types( $items ) {
|
252 |
-
|
|
|
253 |
foreach ( $custom_types as $type ) {
|
254 |
if ( empty($type) ) {
|
255 |
continue;
|
@@ -636,7 +638,8 @@ function wpcf_admin_export_selected_data ( array $items, $_type = 'all', $return
|
|
636 |
|
637 |
// Get custom types
|
638 |
if ( 'types' == $_type || 'all' == $_type ) {
|
639 |
-
|
|
|
640 |
// Get custom types
|
641 |
// TODO Document $items
|
642 |
if ( !empty( $items ) ) {
|
@@ -1078,7 +1081,8 @@ function wpcf_admin_import_data_from_xmlstring( $data = '', $_type = 'types',
|
|
1078 |
if ( !empty( $data->types ) && 'types' == $_type ) {
|
1079 |
$imported = true;
|
1080 |
|
1081 |
-
|
|
|
1082 |
$types = array();
|
1083 |
$types_check = array();
|
1084 |
// Set insert data from XML
|
133 |
function wpcf_module_inline_table_post_types() {
|
134 |
// dont add module manager meta box on new post type form
|
135 |
if ( defined( 'MODMAN_PLUGIN_NAME' ) && isset( $_GET['wpcf-post-type'] ) ) {
|
136 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
137 |
+
$_custom_types = $post_type_option->get_post_types();
|
138 |
if ( isset( $_custom_types[$_GET['wpcf-post-type']] ) ) {
|
139 |
$_post_type = $_custom_types[$_GET['wpcf-post-type']];
|
140 |
// add module manager meta box to post type form
|
250 |
}
|
251 |
|
252 |
function wpcf_register_modules_items_types( $items ) {
|
253 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
254 |
+
$custom_types = $post_type_option->get_post_types();
|
255 |
foreach ( $custom_types as $type ) {
|
256 |
if ( empty($type) ) {
|
257 |
continue;
|
638 |
|
639 |
// Get custom types
|
640 |
if ( 'types' == $_type || 'all' == $_type ) {
|
641 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
642 |
+
$custom_types = $post_type_option->get_post_types();
|
643 |
// Get custom types
|
644 |
// TODO Document $items
|
645 |
if ( !empty( $items ) ) {
|
1081 |
if ( !empty( $data->types ) && 'types' == $_type ) {
|
1082 |
$imported = true;
|
1083 |
|
1084 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
1085 |
+
$types_existing = $post_type_option->get_post_types();
|
1086 |
$types = array();
|
1087 |
$types_check = array();
|
1088 |
// Set insert data from XML
|
vendor/toolset/types/embedded/includes/wpml.php
CHANGED
@@ -378,7 +378,8 @@ function wpcf_admin_bulk_string_translation() {
|
|
378 |
}
|
379 |
|
380 |
// Register types
|
381 |
-
|
|
|
382 |
foreach ( $custom_types as $post_type => $data ) {
|
383 |
wpcf_custom_types_register_translation( $post_type, $data );
|
384 |
}
|
378 |
}
|
379 |
|
380 |
// Register types
|
381 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
382 |
+
$custom_types = $post_type_option->get_post_types();
|
383 |
foreach ( $custom_types as $post_type => $data ) {
|
384 |
wpcf_custom_types_register_translation( $post_type, $data );
|
385 |
}
|
vendor/toolset/types/embedded/resources/js/basic.js
CHANGED
@@ -19,6 +19,8 @@ if( typeof typesStatusBasicJsScript === 'undefined' ) {
|
|
19 |
|
20 |
jQuery( document ).ready( function() {
|
21 |
|
|
|
|
|
22 |
/**
|
23 |
* check description field
|
24 |
*/
|
@@ -105,7 +107,7 @@ if( typeof typesStatusBasicJsScript === 'undefined' ) {
|
|
105 |
// containment: 'parent'
|
106 |
// });
|
107 |
|
108 |
-
|
109 |
jQuery( this ).parent().children( ".collapsible" ).slideToggle( "fast", function() {
|
110 |
var toggle = '';
|
111 |
if( jQuery( this ).is( ":visible" ) ) {
|
@@ -144,16 +146,16 @@ if( typeof typesStatusBasicJsScript === 'undefined' ) {
|
|
144 |
}
|
145 |
} );
|
146 |
} );
|
147 |
-
|
148 |
jQuery( '#' + jQuery( this ).attr( 'id' ) + '-display-value' ).prev( 'label' ).html( jQuery( this ).val() );
|
149 |
} );
|
150 |
jQuery( '.form-error' ).parents( '.collapsed' ).slideDown();
|
151 |
-
|
152 |
jQuery( this ).parents( '.collapsed' ).slideDown();
|
153 |
} );
|
154 |
|
155 |
// Delete AJAX added element
|
156 |
-
|
157 |
if( jQuery( this ).attr( 'href' ) == 'javascript:void(0);' ) {
|
158 |
jQuery( this ).parent().fadeOut( function() {
|
159 |
jQuery( this ).remove();
|
@@ -164,7 +166,7 @@ if( typeof typesStatusBasicJsScript === 'undefined' ) {
|
|
164 |
/*
|
165 |
* Generic AJAX call (link). Parameters can be used.
|
166 |
*/
|
167 |
-
|
168 |
var callback = wpcfGetParameterByName( 'wpcf_ajax_callback', jQuery( this ).attr( 'href' ) );
|
169 |
var update = wpcfGetParameterByName( 'wpcf_ajax_update', jQuery( this ).attr( 'href' ) );
|
170 |
var updateAdd = wpcfGetParameterByName( 'wpcf_ajax_update_add', jQuery( this ).attr( 'href' ) );
|
19 |
|
20 |
jQuery( document ).ready( function() {
|
21 |
|
22 |
+
var wpcfBody = jQuery( 'body' );
|
23 |
+
|
24 |
/**
|
25 |
* check description field
|
26 |
*/
|
107 |
// containment: 'parent'
|
108 |
// });
|
109 |
|
110 |
+
wpcfBody.on( 'click', '.wpcf-form-fieldset legend', function() {
|
111 |
jQuery( this ).parent().children( ".collapsible" ).slideToggle( "fast", function() {
|
112 |
var toggle = '';
|
113 |
if( jQuery( this ).is( ":visible" ) ) {
|
146 |
}
|
147 |
} );
|
148 |
} );
|
149 |
+
wpcfBody.on( 'keyup', '.wpcf-form-groups-radio-update-title-display-value', function() {
|
150 |
jQuery( '#' + jQuery( this ).attr( 'id' ) + '-display-value' ).prev( 'label' ).html( jQuery( this ).val() );
|
151 |
} );
|
152 |
jQuery( '.form-error' ).parents( '.collapsed' ).slideDown();
|
153 |
+
wpcfBody.on( 'focus', '.wpcf-form input', function() {
|
154 |
jQuery( this ).parents( '.collapsed' ).slideDown();
|
155 |
} );
|
156 |
|
157 |
// Delete AJAX added element
|
158 |
+
wpcfBody.on( 'click', '.wpcf-form-fields-delete', function() {
|
159 |
if( jQuery( this ).attr( 'href' ) == 'javascript:void(0);' ) {
|
160 |
jQuery( this ).parent().fadeOut( function() {
|
161 |
jQuery( this ).remove();
|
166 |
/*
|
167 |
* Generic AJAX call (link). Parameters can be used.
|
168 |
*/
|
169 |
+
wpcfBody.on( 'click', '.wpcf-ajax-link', function() {
|
170 |
var callback = wpcfGetParameterByName( 'wpcf_ajax_callback', jQuery( this ).attr( 'href' ) );
|
171 |
var update = wpcfGetParameterByName( 'wpcf_ajax_update', jQuery( this ).attr( 'href' ) );
|
172 |
var updateAdd = wpcfGetParameterByName( 'wpcf_ajax_update_add', jQuery( this ).attr( 'href' ) );
|
vendor/toolset/types/embedded/resources/js/custom-fields-form-filter.js
CHANGED
@@ -55,7 +55,7 @@ function _wpcfFilterTitle(e, title, title_not_empty, title_empty) {
|
|
55 |
/**
|
56 |
* Autocomplete slugs
|
57 |
*/
|
58 |
-
jQuery('
|
59 |
var slug = jQuery(this).val();
|
60 |
if ( '' == slug ){
|
61 |
// jQuery(this).val(wpcf_slugize(jQuery(this).parent().find('input.wpcf-forms-field-name').val()));
|
55 |
/**
|
56 |
* Autocomplete slugs
|
57 |
*/
|
58 |
+
jQuery( 'body' ).on('blur focus click', 'input.wpcf-forms-field-slug', function(){
|
59 |
var slug = jQuery(this).val();
|
60 |
if ( '' == slug ){
|
61 |
// jQuery(this).val(wpcf_slugize(jQuery(this).parent().find('input.wpcf-forms-field-name').val()));
|
vendor/toolset/types/embedded/resources/js/fields-form.js
CHANGED
@@ -104,7 +104,7 @@ jQuery(document).ready(function($){
|
|
104 |
/**
|
105 |
* confitonal logic button close on group edit screen
|
106 |
*/
|
107 |
-
$('#conditional-logic-button-ok'
|
108 |
$(this).parent().slideUp('slow', function() {
|
109 |
$('#conditional-logic-button-open').fadeIn();
|
110 |
});
|
104 |
/**
|
105 |
* confitonal logic button close on group edit screen
|
106 |
*/
|
107 |
+
$( 'body' ).on('click', '#conditional-logic-button-ok', function(){
|
108 |
$(this).parent().slideUp('slow', function() {
|
109 |
$('#conditional-logic-button-open').fadeIn();
|
110 |
});
|
vendor/toolset/types/embedded/resources/js/fields-post.js
CHANGED
@@ -21,7 +21,7 @@ jQuery(document).ready(function(){
|
|
21 |
/*
|
22 |
* Generic AJAX call (link). Parameters can be used.
|
23 |
*/
|
24 |
-
jQuery('
|
25 |
var callback = wpcfGetParameterByName('wpcf_ajax_callback', jQuery(this).attr('href'));
|
26 |
var update = wpcfGetParameterByName('wpcf_ajax_update', jQuery(this).attr('href'));
|
27 |
var updateAdd = wpcfGetParameterByName('wpcf_ajax_update_add', jQuery(this).attr('href'));
|
@@ -127,7 +127,7 @@ jQuery(document).ready(function(){
|
|
127 |
jQuery('#post .wpcf-cd-failed, #post .wpcf-cd-group-failed').remove();
|
128 |
});
|
129 |
|
130 |
-
jQuery('.wpcf-pr-save-all-link, .wpcf-pr-save-ajax'
|
131 |
jQuery(this).parents('.wpcf-pr-has-entries').find('.wpcf-cd-failed').remove();
|
132 |
});
|
133 |
|
21 |
/*
|
22 |
* Generic AJAX call (link). Parameters can be used.
|
23 |
*/
|
24 |
+
jQuery( 'body' ).on( 'click', '.wpcf-ajax-link', function(){
|
25 |
var callback = wpcfGetParameterByName('wpcf_ajax_callback', jQuery(this).attr('href'));
|
26 |
var update = wpcfGetParameterByName('wpcf_ajax_update', jQuery(this).attr('href'));
|
27 |
var updateAdd = wpcfGetParameterByName('wpcf_ajax_update_add', jQuery(this).attr('href'));
|
127 |
jQuery('#post .wpcf-cd-failed, #post .wpcf-cd-group-failed').remove();
|
128 |
});
|
129 |
|
130 |
+
jQuery( 'body' ).on( 'click', '.wpcf-pr-save-all-link, .wpcf-pr-save-ajax', function(){
|
131 |
jQuery(this).parents('.wpcf-pr-has-entries').find('.wpcf-cd-failed').remove();
|
132 |
});
|
133 |
|
vendor/toolset/types/embedded/resources/js/post-relationship.js
CHANGED
@@ -435,7 +435,7 @@ jQuery(document).ready(function($) {
|
|
435 |
});
|
436 |
return false;
|
437 |
});
|
438 |
-
jQuery('.wpcf-pr-delete-ajax'
|
439 |
if ($(this).hasClass('disabled'))
|
440 |
return false;
|
441 |
|
@@ -499,7 +499,7 @@ jQuery(document).ready(function($) {
|
|
499 |
});
|
500 |
return false;
|
501 |
});
|
502 |
-
jQuery('.wpcf-pr-update-belongs'
|
503 |
var object = jQuery(this);
|
504 |
jQuery.ajax({
|
505 |
url: jQuery(this).attr('href'),
|
435 |
});
|
436 |
return false;
|
437 |
});
|
438 |
+
jQuery( 'body' ).on( 'click', '.wpcf-pr-delete-ajax', function () {
|
439 |
if ($(this).hasClass('disabled'))
|
440 |
return false;
|
441 |
|
499 |
});
|
500 |
return false;
|
501 |
});
|
502 |
+
jQuery( 'body' ).on( 'click', '.wpcf-pr-update-belongs', function () {
|
503 |
var object = jQuery(this);
|
504 |
jQuery.ajax({
|
505 |
url: jQuery(this).attr('href'),
|
vendor/toolset/types/embedded/resources/js/repetitive.js
CHANGED
@@ -45,7 +45,7 @@ jQuery(document).ready(function(){
|
|
45 |
});
|
46 |
return false;
|
47 |
});
|
48 |
-
jQuery('
|
49 |
|
50 |
var wrapper = jQuery(this).parents('.wpcf-repetitive-sortable-wrapper');
|
51 |
|
45 |
});
|
46 |
return false;
|
47 |
});
|
48 |
+
jQuery( 'body' ).on( 'click', '.wpcf-repetitive-delete', function(){
|
49 |
|
50 |
var wrapper = jQuery(this).parents('.wpcf-repetitive-sortable-wrapper');
|
51 |
|
vendor/toolset/types/includes/ajax.php
CHANGED
@@ -68,6 +68,10 @@ function wpcf_ajax( $fallthrough )
|
|
68 |
}
|
69 |
require_once WPCF_INC_ABSPATH.'/classes/class.wpcf.roles.php';
|
70 |
|
|
|
|
|
|
|
|
|
71 |
/**
|
72 |
* check permissions
|
73 |
*/
|
@@ -356,7 +360,7 @@ function wpcf_ajax( $fallthrough )
|
|
356 |
if ( empty($post_type) ) {
|
357 |
wpcf_ajax_helper_print_error_and_die();
|
358 |
}
|
359 |
-
$custom_types =
|
360 |
$custom_types[$post_type]['disabled'] = 1;
|
361 |
$custom_types[$post_type][TOOLSET_EDIT_LAST] = time();
|
362 |
update_option(WPCF_OPTION_NAME_CUSTOM_TYPES, $custom_types);
|
@@ -374,7 +378,7 @@ function wpcf_ajax( $fallthrough )
|
|
374 |
if ( empty($post_type) ) {
|
375 |
wpcf_ajax_helper_print_error_and_die();
|
376 |
}
|
377 |
-
$custom_types =
|
378 |
unset($custom_types[$post_type]['disabled']);
|
379 |
$custom_types[$post_type][TOOLSET_EDIT_LAST] = time();
|
380 |
update_option(WPCF_OPTION_NAME_CUSTOM_TYPES, $custom_types);
|
@@ -392,7 +396,7 @@ function wpcf_ajax( $fallthrough )
|
|
392 |
if ( empty($post_type) ) {
|
393 |
wpcf_ajax_helper_print_error_and_die();
|
394 |
}
|
395 |
-
$post_types =
|
396 |
|
397 |
/**
|
398 |
* Delete relation between custom posts types
|
@@ -459,7 +463,7 @@ function wpcf_ajax( $fallthrough )
|
|
459 |
wpcf_ajax_helper_print_error_and_die();
|
460 |
}
|
461 |
|
462 |
-
$post_types =
|
463 |
|
464 |
$i = 0;
|
465 |
$key = false;
|
@@ -544,7 +548,7 @@ function wpcf_ajax( $fallthrough )
|
|
544 |
&& is_array($custom_taxonomies[$key]['supports'])
|
545 |
&& !empty($custom_taxonomies[$key]['supports'])
|
546 |
) {
|
547 |
-
$custom_types =
|
548 |
foreach( array_keys($custom_taxonomies[$key]['supports']) as $custom_type ) {
|
549 |
/**
|
550 |
* avoid to create fake CPT from old data
|
@@ -959,7 +963,8 @@ function wpcf_ajax_helper_get_post_type()
|
|
959 |
return false;
|
960 |
}
|
961 |
require_once WPCF_INC_ABSPATH . '/custom-types.php';
|
962 |
-
|
|
|
963 |
if (
|
964 |
isset($custom_types[$_REQUEST['wpcf-post-type']])
|
965 |
&& isset($custom_types[$_REQUEST['wpcf-post-type']]['slug'])
|
68 |
}
|
69 |
require_once WPCF_INC_ABSPATH.'/classes/class.wpcf.roles.php';
|
70 |
|
71 |
+
// We need to require this file manually because this runs before the autoloader is registered.
|
72 |
+
require_once TYPES_ABSPATH . '/application/controllers/utils/post_type_option.php';
|
73 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
74 |
+
|
75 |
/**
|
76 |
* check permissions
|
77 |
*/
|
360 |
if ( empty($post_type) ) {
|
361 |
wpcf_ajax_helper_print_error_and_die();
|
362 |
}
|
363 |
+
$custom_types = $post_type_option->get_post_types();
|
364 |
$custom_types[$post_type]['disabled'] = 1;
|
365 |
$custom_types[$post_type][TOOLSET_EDIT_LAST] = time();
|
366 |
update_option(WPCF_OPTION_NAME_CUSTOM_TYPES, $custom_types);
|
378 |
if ( empty($post_type) ) {
|
379 |
wpcf_ajax_helper_print_error_and_die();
|
380 |
}
|
381 |
+
$custom_types = $post_type_option->get_post_types();
|
382 |
unset($custom_types[$post_type]['disabled']);
|
383 |
$custom_types[$post_type][TOOLSET_EDIT_LAST] = time();
|
384 |
update_option(WPCF_OPTION_NAME_CUSTOM_TYPES, $custom_types);
|
396 |
if ( empty($post_type) ) {
|
397 |
wpcf_ajax_helper_print_error_and_die();
|
398 |
}
|
399 |
+
$post_types = $post_type_option->get_post_types();
|
400 |
|
401 |
/**
|
402 |
* Delete relation between custom posts types
|
463 |
wpcf_ajax_helper_print_error_and_die();
|
464 |
}
|
465 |
|
466 |
+
$post_types = $post_type_option->get_post_types();
|
467 |
|
468 |
$i = 0;
|
469 |
$key = false;
|
548 |
&& is_array($custom_taxonomies[$key]['supports'])
|
549 |
&& !empty($custom_taxonomies[$key]['supports'])
|
550 |
) {
|
551 |
+
$custom_types = $post_type_option->get_post_types();
|
552 |
foreach( array_keys($custom_taxonomies[$key]['supports']) as $custom_type ) {
|
553 |
/**
|
554 |
* avoid to create fake CPT from old data
|
963 |
return false;
|
964 |
}
|
965 |
require_once WPCF_INC_ABSPATH . '/custom-types.php';
|
966 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
967 |
+
$custom_types = $post_type_option->get_post_types();
|
968 |
if (
|
969 |
isset($custom_types[$_REQUEST['wpcf-post-type']])
|
970 |
&& isset($custom_types[$_REQUEST['wpcf-post-type']]['slug'])
|
vendor/toolset/types/includes/classes/class.types.admin.edit.post.type.php
CHANGED
@@ -81,40 +81,8 @@ class Types_Admin_Edit_Post_Type extends Types_Admin_Page
|
|
81 |
),
|
82 |
);
|
83 |
|
84 |
-
/**
|
85 |
-
* Summary.
|
86 |
-
*
|
87 |
-
* Description.
|
88 |
-
*
|
89 |
-
* @since x.x.x
|
90 |
-
*
|
91 |
-
* @param type $var Description.
|
92 |
-
* @param array $args {
|
93 |
-
* Short description about this hash.
|
94 |
-
*
|
95 |
-
* @type type $var Description.
|
96 |
-
* @type type $var Description.
|
97 |
-
* }
|
98 |
-
* @param type $var Description.
|
99 |
-
*/
|
100 |
$this->boxes = apply_filters('wpcf_meta_box_order_defaults', $this->boxes, $this->post_type);
|
101 |
|
102 |
-
/**
|
103 |
-
* Summary.
|
104 |
-
*
|
105 |
-
* Description.
|
106 |
-
*
|
107 |
-
* @since x.x.x
|
108 |
-
*
|
109 |
-
* @param type $var Description.
|
110 |
-
* @param array $args {
|
111 |
-
* Short description about this hash.
|
112 |
-
*
|
113 |
-
* @type type $var Description.
|
114 |
-
* @type type $var Description.
|
115 |
-
* }
|
116 |
-
* @param type $var Description.
|
117 |
-
*/
|
118 |
$this->boxes = apply_filters('wpcf_meta_box_post_type', $this->boxes);
|
119 |
|
120 |
/**
|
@@ -1116,7 +1084,8 @@ class Types_Admin_Edit_Post_Type extends Types_Admin_Page
|
|
1116 |
}
|
1117 |
|
1118 |
$data['slug'] = $post_type;
|
1119 |
-
|
|
|
1120 |
$protected_data_check = array();
|
1121 |
|
1122 |
if ( wpcf_is_builtin_post_types($data['slug']) ) {
|
@@ -1158,10 +1127,7 @@ class Types_Admin_Edit_Post_Type extends Types_Admin_Page
|
|
1158 |
* update post meta "_wp_types_group_post_types"
|
1159 |
*/
|
1160 |
$sql = $wpdb->prepare(
|
1161 |
-
|
1162 |
-
'select meta_id, meta_value from %s where meta_key = %%s',
|
1163 |
-
$wpdb->postmeta
|
1164 |
-
),
|
1165 |
'_wp_types_group_post_types'
|
1166 |
);
|
1167 |
$all_meta = $wpdb->get_results($sql, OBJECT_K);
|
81 |
),
|
82 |
);
|
83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
$this->boxes = apply_filters('wpcf_meta_box_order_defaults', $this->boxes, $this->post_type);
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
$this->boxes = apply_filters('wpcf_meta_box_post_type', $this->boxes);
|
87 |
|
88 |
/**
|
1084 |
}
|
1085 |
|
1086 |
$data['slug'] = $post_type;
|
1087 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
1088 |
+
$custom_types = $post_type_option->get_post_types();
|
1089 |
$protected_data_check = array();
|
1090 |
|
1091 |
if ( wpcf_is_builtin_post_types($data['slug']) ) {
|
1127 |
* update post meta "_wp_types_group_post_types"
|
1128 |
*/
|
1129 |
$sql = $wpdb->prepare(
|
1130 |
+
"select meta_id, meta_value from {$wpdb->postmeta} where meta_key = %%s",
|
|
|
|
|
|
|
1131 |
'_wp_types_group_post_types'
|
1132 |
);
|
1133 |
$all_meta = $wpdb->get_results($sql, OBJECT_K);
|
vendor/toolset/types/includes/classes/class.types.admin.edit.taxonomy.php
CHANGED
@@ -914,7 +914,8 @@ class Types_Admin_Edit_Taxonomy extends Types_Admin_Page
|
|
914 |
/**
|
915 |
* Sync with post types
|
916 |
*/
|
917 |
-
|
|
|
918 |
foreach ( $post_types as $id => $type ) {
|
919 |
if ( !empty( $data['supports'] ) && array_key_exists( $id, $data['supports'] ) ) {
|
920 |
if ( empty($post_types[$id]['taxonomies'][$data['slug']]) ) {
|
914 |
/**
|
915 |
* Sync with post types
|
916 |
*/
|
917 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
918 |
+
$post_types = $post_type_option->get_post_types();
|
919 |
foreach ( $post_types as $id => $type ) {
|
920 |
if ( !empty( $data['supports'] ) && array_key_exists( $id, $data['supports'] ) ) {
|
921 |
if ( empty($post_types[$id]['taxonomies'][$data['slug']]) ) {
|
vendor/toolset/types/includes/classes/class.types.admin.page.php
CHANGED
@@ -346,23 +346,7 @@ abstract class Types_Admin_Page
|
|
346 |
}
|
347 |
}
|
348 |
|
349 |
-
|
350 |
-
* Summary.
|
351 |
-
*
|
352 |
-
* Description.
|
353 |
-
*
|
354 |
-
* @since x.x.x
|
355 |
-
* @access (for functions: only use if private)
|
356 |
-
*
|
357 |
-
* @see Function/method/class relied on
|
358 |
-
* @link URL
|
359 |
-
* @global type $varname Description.
|
360 |
-
* @global type $varname Description.
|
361 |
-
*
|
362 |
-
* @param type $var Description.
|
363 |
-
* @param type $var Optional. Description.
|
364 |
-
* @return type Description.
|
365 |
-
*/
|
366 |
public function add_box_howto($boxes)
|
367 |
{
|
368 |
$displaying_custom_content = include( WPCF_ABSPATH . '/marketing/displaying-custom-content/title-content.php' );
|
@@ -674,7 +658,8 @@ abstract class Types_Admin_Page
|
|
674 |
{
|
675 |
$post_type = '';
|
676 |
if (isset($_REQUEST[$request_name]) ) {
|
677 |
-
|
|
|
678 |
if ( array_key_exists($_REQUEST[$request_name], $post_types) ) {
|
679 |
$post_type = sanitize_text_field( $_REQUEST[$request_name] );
|
680 |
}
|
346 |
}
|
347 |
}
|
348 |
|
349 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
350 |
public function add_box_howto($boxes)
|
351 |
{
|
352 |
$displaying_custom_content = include( WPCF_ABSPATH . '/marketing/displaying-custom-content/title-content.php' );
|
658 |
{
|
659 |
$post_type = '';
|
660 |
if (isset($_REQUEST[$request_name]) ) {
|
661 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
662 |
+
$post_types = $post_type_option->get_post_types();
|
663 |
if ( array_key_exists($_REQUEST[$request_name], $post_types) ) {
|
664 |
$post_type = sanitize_text_field( $_REQUEST[$request_name] );
|
665 |
}
|
vendor/toolset/types/includes/classes/class.types.admin.post-type.php
CHANGED
@@ -66,8 +66,8 @@ class Types_Admin_Post_Type extends Types_Admin_Page
|
|
66 |
if ( empty($post_type_slug) ) {
|
67 |
return wpcf_custom_types_default();
|
68 |
}
|
69 |
-
|
70 |
-
$custom_types =
|
71 |
if ( isset( $custom_types[$post_type_slug] ) ) {
|
72 |
$post_type = $custom_types[$post_type_slug];
|
73 |
$post_type['update'] = true;
|
66 |
if ( empty($post_type_slug) ) {
|
67 |
return wpcf_custom_types_default();
|
68 |
}
|
69 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
70 |
+
$custom_types = $post_type_option->get_post_types();
|
71 |
if ( isset( $custom_types[$post_type_slug] ) ) {
|
72 |
$post_type = $custom_types[$post_type_slug];
|
73 |
$post_type['update'] = true;
|
vendor/toolset/types/includes/classes/class.types.admin.post.types.list.table.php
CHANGED
@@ -43,10 +43,6 @@ class Types_Admin_Post_Types_List_Table extends WP_List_Table
|
|
43 |
var $buildin_post_types;
|
44 |
var $bulk_action_field_name = 'wpcf_cpt_ids';
|
45 |
|
46 |
-
/** ************************************************************************
|
47 |
-
* REQUIRED. Set up a constructor that references the parent constructor. We
|
48 |
-
* use the parent reference to set some default configs.
|
49 |
-
***************************************************************************/
|
50 |
function __construct()
|
51 |
{
|
52 |
//Set parent defaults
|
@@ -56,31 +52,12 @@ class Types_Admin_Post_Types_List_Table extends WP_List_Table
|
|
56 |
'ajax' => true //does this table support ajax?
|
57 |
) );
|
58 |
|
59 |
-
|
|
|
60 |
$this->buildin_post_types = wpcf_get_builtin_in_post_types();
|
61 |
}
|
62 |
|
63 |
-
|
64 |
-
* Recommended. This method is called when the parent class can't find a method
|
65 |
-
* specifically build for a given column. Generally, it's recommended to include
|
66 |
-
* one method for each column you want to render, keeping your package class
|
67 |
-
* neat and organized. For example, if the class needs to process a column
|
68 |
-
* named 'title', it would first see if a method named $this->column_title()
|
69 |
-
* exists - if it does, that method will be used. If it doesn't, this one will
|
70 |
-
* be used. Generally, you should try to use custom column methods as much as
|
71 |
-
* possible.
|
72 |
-
*
|
73 |
-
* Since we have defined a column_title() method later on, this method doesn't
|
74 |
-
* need to concern itself with any column with a name of 'title'. Instead, it
|
75 |
-
* needs to handle everything else.
|
76 |
-
*
|
77 |
-
* For more detailed insight into how columns are handled, take a look at
|
78 |
-
* WP_List_Table::single_row_columns()
|
79 |
-
*
|
80 |
-
* @param array $item A singular item (one full row's worth of data)
|
81 |
-
* @param array $column_name The name/slug of the column to be processed
|
82 |
-
* @return string Text or HTML to be placed inside the column <td>
|
83 |
-
**************************************************************************/
|
84 |
function column_default($item, $column_name)
|
85 |
{
|
86 |
switch($column_name){
|
43 |
var $buildin_post_types;
|
44 |
var $bulk_action_field_name = 'wpcf_cpt_ids';
|
45 |
|
|
|
|
|
|
|
|
|
46 |
function __construct()
|
47 |
{
|
48 |
//Set parent defaults
|
52 |
'ajax' => true //does this table support ajax?
|
53 |
) );
|
54 |
|
55 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
56 |
+
$this->custom_types = $post_type_option->get_post_types();
|
57 |
$this->buildin_post_types = wpcf_get_builtin_in_post_types();
|
58 |
}
|
59 |
|
60 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
function column_default($item, $column_name)
|
62 |
{
|
63 |
switch($column_name){
|
vendor/toolset/types/includes/classes/class.types.admin.taxonomies.list.table.php
CHANGED
@@ -365,7 +365,8 @@ class Types_Admin_Taxonomies_List_Table extends WP_List_Table
|
|
365 |
* update post types
|
366 |
*/
|
367 |
if ( count($slugs_to_delete) ) {
|
368 |
-
|
|
|
369 |
if ( !empty($custom_types) ) {
|
370 |
foreach ( $slugs_to_delete as $slug ) {
|
371 |
foreach ( $custom_types as $custom_key => $data ) {
|
365 |
* update post types
|
366 |
*/
|
367 |
if ( count($slugs_to_delete) ) {
|
368 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
369 |
+
$custom_types = $post_type_option->get_post_types();
|
370 |
if ( !empty($custom_types) ) {
|
371 |
foreach ( $slugs_to_delete as $slug ) {
|
372 |
foreach ( $custom_types as $custom_key => $data ) {
|
vendor/toolset/types/includes/classes/class.wpcf.marketing.messages.php
CHANGED
@@ -117,7 +117,8 @@ class WPCF_Types_Marketing_Messages extends WPCF_Types_Marketing
|
|
117 |
is_array($_GET)
|
118 |
&& array_key_exists('wpcf-post-type', $_GET)
|
119 |
) {
|
120 |
-
|
|
|
121 |
$candidate_key = sanitize_text_field( $_GET['wpcf-post-type'] );
|
122 |
if ( array_key_exists($candidate_key, $types ) ) {
|
123 |
$text = preg_replace( '/PPP/', $types[$candidate_key]['labels']['name'], $text);
|
@@ -151,7 +152,6 @@ class WPCF_Types_Marketing_Messages extends WPCF_Types_Marketing
|
|
151 |
}
|
152 |
$text = preg_replace( '/TTT/', $ttt, $text);
|
153 |
if ( array_key_exists('supports', $taxonomies[$candidate_key]) ) {
|
154 |
-
$types = get_option(WPCF_OPTION_NAME_CUSTOM_TYPES, array());
|
155 |
$post_type = array_keys($taxonomies[$candidate_key]['supports']);
|
156 |
if ( !empty($post_type) ) {
|
157 |
$post_type = $post_type[array_rand($post_type)];
|
117 |
is_array($_GET)
|
118 |
&& array_key_exists('wpcf-post-type', $_GET)
|
119 |
) {
|
120 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
121 |
+
$types = $post_type_option->get_post_types();
|
122 |
$candidate_key = sanitize_text_field( $_GET['wpcf-post-type'] );
|
123 |
if ( array_key_exists($candidate_key, $types ) ) {
|
124 |
$text = preg_replace( '/PPP/', $types[$candidate_key]['labels']['name'], $text);
|
152 |
}
|
153 |
$text = preg_replace( '/TTT/', $ttt, $text);
|
154 |
if ( array_key_exists('supports', $taxonomies[$candidate_key]) ) {
|
|
|
155 |
$post_type = array_keys($taxonomies[$candidate_key]['supports']);
|
156 |
if ( !empty($post_type) ) {
|
157 |
$post_type = $post_type[array_rand($post_type)];
|
vendor/toolset/types/includes/classes/class.wpcf.roles.php
CHANGED
@@ -342,7 +342,8 @@ class WPCF_Roles
|
|
342 |
|
343 |
public static function user_can_edit_custom_post_by_slug($slug)
|
344 |
{
|
345 |
-
|
|
|
346 |
if (isset($entries[$slug])) {
|
347 |
return self::user_can_edit('custom-post-type', $entries[$slug]);
|
348 |
}
|
342 |
|
343 |
public static function user_can_edit_custom_post_by_slug($slug)
|
344 |
{
|
345 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
346 |
+
$entries = $post_type_option->get_post_types();
|
347 |
if (isset($entries[$slug])) {
|
348 |
return self::user_can_edit('custom-post-type', $entries[$slug]);
|
349 |
}
|
vendor/toolset/types/includes/custom-types-form.php
CHANGED
@@ -66,7 +66,8 @@ function wpcf_admin_custom_types_form_submit($form)
|
|
66 |
}
|
67 |
|
68 |
$data['slug'] = $post_type;
|
69 |
-
|
|
|
70 |
$protected_data_check = array();
|
71 |
|
72 |
if ( wpcf_is_builtin_post_types($data['slug']) ) {
|
66 |
}
|
67 |
|
68 |
$data['slug'] = $post_type;
|
69 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
70 |
+
$custom_types = $post_type_option->get_post_types();
|
71 |
$protected_data_check = array();
|
72 |
|
73 |
if ( wpcf_is_builtin_post_types($data['slug']) ) {
|
vendor/toolset/types/includes/custom-types-taxonomies-list.php
CHANGED
@@ -4,7 +4,8 @@
|
|
4 |
*/
|
5 |
|
6 |
function wpcf_admin_ctt_list_header() {
|
7 |
-
$
|
|
|
8 |
$custom_taxonomies = get_option( WPCF_OPTION_NAME_CUSTOM_TAXONOMIES, array() );
|
9 |
|
10 |
if ( empty( $custom_types ) && empty( $custom_taxonomies ) ) {
|
4 |
*/
|
5 |
|
6 |
function wpcf_admin_ctt_list_header() {
|
7 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
8 |
+
$custom_types = $post_type_option->get_post_types();
|
9 |
$custom_taxonomies = get_option( WPCF_OPTION_NAME_CUSTOM_TAXONOMIES, array() );
|
10 |
|
11 |
if ( empty( $custom_types ) && empty( $custom_taxonomies ) ) {
|
vendor/toolset/types/includes/import-export.php
CHANGED
@@ -888,7 +888,8 @@ function wpcf_admin_import_export_settings($data)
|
|
888 |
'#type' => 'markup',
|
889 |
'#markup' => '<h2>' . __( 'Post Types to be added/updated', 'wpcf' ) . '</h2>',
|
890 |
);
|
891 |
-
|
|
|
892 |
$types_check = array();
|
893 |
$types_to_be_deleted = array();
|
894 |
foreach ( $data->types->type as $type ) {
|
888 |
'#type' => 'markup',
|
889 |
'#markup' => '<h2>' . __( 'Post Types to be added/updated', 'wpcf' ) . '</h2>',
|
890 |
);
|
891 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
892 |
+
$types_existing = $post_type_option->get_post_types();
|
893 |
$types_check = array();
|
894 |
$types_to_be_deleted = array();
|
895 |
foreach ( $data->types->type as $type ) {
|
vendor/toolset/types/includes/post-relationship.php
CHANGED
@@ -332,7 +332,8 @@ function wpcf_admin_metabox_relationship($post_type)
|
|
332 |
)
|
333 |
);
|
334 |
|
335 |
-
$
|
|
|
336 |
|
337 |
$is_error = false;
|
338 |
$error_message = '';
|
332 |
)
|
333 |
);
|
334 |
|
335 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
336 |
+
$custom_types = $post_type_option->get_post_types();
|
337 |
|
338 |
$is_error = false;
|
339 |
$error_message = '';
|
vendor/toolset/types/resources/js/collapsible.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
jQuery(document).ready(function(){
|
2 |
-
jQuery('
|
3 |
var toggleButton = jQuery(this);
|
4 |
var toggleDiv = jQuery('#'+jQuery(this).attr('id')+'-toggle');
|
5 |
toggleDiv.slideToggle(function(){
|
1 |
jQuery(document).ready(function(){
|
2 |
+
jQuery( 'body' ).on( 'click', '.wpcf-collapsible-button', function() {
|
3 |
var toggleButton = jQuery(this);
|
4 |
var toggleDiv = jQuery('#'+jQuery(this).attr('id')+'-toggle');
|
5 |
toggleDiv.slideToggle(function(){
|
vendor/toolset/types/resources/js/fields-form.js
CHANGED
@@ -3,6 +3,8 @@
|
|
3 |
*/
|
4 |
jQuery(document).ready(function($){
|
5 |
|
|
|
|
|
6 |
/**
|
7 |
* Store all current used field slugs
|
8 |
* @type {Array}
|
@@ -597,7 +599,7 @@ jQuery(document).ready(function($){
|
|
597 |
/**
|
598 |
* update box fifle by field name
|
599 |
*/
|
600 |
-
|
601 |
var val = $(this).val();
|
602 |
if ( val ) {
|
603 |
val = val.replace(/</, '<');
|
@@ -652,7 +654,7 @@ jQuery(document).ready(function($){
|
|
652 |
});
|
653 |
if (passed == false) {
|
654 |
// Bind message fade out
|
655 |
-
|
656 |
$(this).parents('.wpcf-compare-unique-value-wrapper').find('.wpcf-form-error-unique-value').fadeOut(function(){
|
657 |
$(this).remove();
|
658 |
});
|
@@ -689,7 +691,7 @@ jQuery(document).ready(function($){
|
|
689 |
});
|
690 |
if (passed == false) {
|
691 |
// Bind message fade out
|
692 |
-
|
693 |
$(this).removeClass('wpcf-name-checked-error').prev('.wpcf-form-error-unique-value').fadeOut(function(){
|
694 |
$(this).remove();
|
695 |
});
|
@@ -752,7 +754,7 @@ jQuery(document).ready(function($){
|
|
752 |
|
753 |
if (passed == false) {
|
754 |
// Bind message fade out
|
755 |
-
|
756 |
$(this).removeClass('wpcf-slug-checked-error').prev('.wpcf-form-error-unique-value').fadeOut(function(){
|
757 |
$(this).remove();
|
758 |
});
|
3 |
*/
|
4 |
jQuery(document).ready(function($){
|
5 |
|
6 |
+
var wpcfBody = $( 'body' );
|
7 |
+
|
8 |
/**
|
9 |
* Store all current used field slugs
|
10 |
* @type {Array}
|
599 |
/**
|
600 |
* update box fifle by field name
|
601 |
*/
|
602 |
+
wpcfBody.on( 'keyup', '.wpcf-forms-set-legend', function(){
|
603 |
var val = $(this).val();
|
604 |
if ( val ) {
|
605 |
val = val.replace(/</, '<');
|
654 |
});
|
655 |
if (passed == false) {
|
656 |
// Bind message fade out
|
657 |
+
wpcfBody.on( 'keyup', '.wpcf-compare-unique-value', function(){
|
658 |
$(this).parents('.wpcf-compare-unique-value-wrapper').find('.wpcf-form-error-unique-value').fadeOut(function(){
|
659 |
$(this).remove();
|
660 |
});
|
691 |
});
|
692 |
if (passed == false) {
|
693 |
// Bind message fade out
|
694 |
+
wpcfBody.on( 'keyup', '.wpcf-forms-field-name', function(){
|
695 |
$(this).removeClass('wpcf-name-checked-error').prev('.wpcf-form-error-unique-value').fadeOut(function(){
|
696 |
$(this).remove();
|
697 |
});
|
754 |
|
755 |
if (passed == false) {
|
756 |
// Bind message fade out
|
757 |
+
wpcfBody.on( 'keyup', '.wpcf-forms-field-slug', function(){
|
758 |
$(this).removeClass('wpcf-slug-checked-error').prev('.wpcf-form-error-unique-value').fadeOut(function(){
|
759 |
$(this).remove();
|
760 |
});
|
vendor/toolset/types/wpcf.php
CHANGED
@@ -202,7 +202,8 @@ function wpcf_is_reserved_name($name, $context, $check_pages = true)
|
|
202 |
}
|
203 |
|
204 |
// Add custom types
|
205 |
-
|
|
|
206 |
$post_types = get_post_types();
|
207 |
if ( !empty( $custom_types ) ) {
|
208 |
$custom_types = array_keys( $custom_types );
|
202 |
}
|
203 |
|
204 |
// Add custom types
|
205 |
+
$post_type_option = new Types_Utils_Post_Type_Option();
|
206 |
+
$custom_types = $post_type_option->get_post_types();
|
207 |
$post_types = get_post_types();
|
208 |
if ( !empty( $custom_types ) ) {
|
209 |
$custom_types = array_keys( $custom_types );
|
wpcf.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://wordpress.org/extend/plugins/types/
|
|
5 |
Description: Toolset Types defines custom content in WordPress. Easily create custom post types, fields and taxonomy and connect everything together.
|
6 |
Author: OnTheGoSystems
|
7 |
Author URI: http://www.onthegosystems.com
|
8 |
-
Version: 2.2.
|
9 |
License: GPLv2 or later
|
10 |
|
11 |
Types is free software: you can redistribute it and/or modify
|
@@ -29,7 +29,7 @@ if ( ! function_exists( 'add_action' ) ) {
|
|
29 |
|
30 |
// version
|
31 |
if ( ! defined( 'TYPES_VERSION' ) ) {
|
32 |
-
define( 'TYPES_VERSION', '2.2.
|
33 |
}
|
34 |
|
35 |
// backward compatibility
|
5 |
Description: Toolset Types defines custom content in WordPress. Easily create custom post types, fields and taxonomy and connect everything together.
|
6 |
Author: OnTheGoSystems
|
7 |
Author URI: http://www.onthegosystems.com
|
8 |
+
Version: 2.2.18
|
9 |
License: GPLv2 or later
|
10 |
|
11 |
Types is free software: you can redistribute it and/or modify
|
29 |
|
30 |
// version
|
31 |
if ( ! defined( 'TYPES_VERSION' ) ) {
|
32 |
+
define( 'TYPES_VERSION', '2.2.18' );
|
33 |
}
|
34 |
|
35 |
// backward compatibility
|