Version Description
- Added additional labels to Post Type Creator and Taxonomy Creator
- We now check the post type name to not have spaces, capital letters or hyphens
- When changing a custom post type name the existing posts get ported as well
Download this release
Release Info
Developer | adispiac |
Plugin | Custom Post Types and Custom Fields creator – WCK |
Version | 1.2.2 |
Comparing to | |
See all releases |
Code changes from version 1.2.1 to 1.2.2
- readme.txt +7 -2
- wck-cptc.php +146 -23
- wck-ctc.php +57 -16
- wck.php +2 -2
readme.txt
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
=== WCK - Custom Fields and Custom Post Types Creator ===
|
2 |
|
3 |
-
Contributors: reflectionmedia, madalin.ungureanu, sareiodata
|
4 |
Donate link: http://www.cozmoslabs.com/wordpress-creation-kit/
|
5 |
Tags: custom fields, custom field, wordpress custom fields, advanced custom fields, custom post type, custom post types, post types, cpt, post type, repeater fields, repeater, repeatable fields, meta box, metabox, taxonomy, taxonomies, custom taxonomy, custom taxonomies, custom, custom fields creator, post meta, meta, get_post_meta, post creator, cck, content types, types
|
6 |
|
7 |
Requires at least: 3.1
|
8 |
Tested up to: 4.4.2
|
9 |
-
Stable tag: 1.2.
|
10 |
|
11 |
A must have tool for creating custom fields, custom post types and taxonomies, fast and without any programming knowledge.
|
12 |
|
@@ -141,6 +141,11 @@ Creating a taxonomy generally automatically creates a special query variable usi
|
|
141 |
10. Taxonomy listing
|
142 |
|
143 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
144 |
= 1.2.1 =
|
145 |
* When renaming a taxonomy we now make sure the terms get ported as well
|
146 |
|
1 |
=== WCK - Custom Fields and Custom Post Types Creator ===
|
2 |
|
3 |
+
Contributors: cozmoslabs, reflectionmedia, madalin.ungureanu, sareiodata, adispiac
|
4 |
Donate link: http://www.cozmoslabs.com/wordpress-creation-kit/
|
5 |
Tags: custom fields, custom field, wordpress custom fields, advanced custom fields, custom post type, custom post types, post types, cpt, post type, repeater fields, repeater, repeatable fields, meta box, metabox, taxonomy, taxonomies, custom taxonomy, custom taxonomies, custom, custom fields creator, post meta, meta, get_post_meta, post creator, cck, content types, types
|
6 |
|
7 |
Requires at least: 3.1
|
8 |
Tested up to: 4.4.2
|
9 |
+
Stable tag: 1.2.2
|
10 |
|
11 |
A must have tool for creating custom fields, custom post types and taxonomies, fast and without any programming knowledge.
|
12 |
|
141 |
10. Taxonomy listing
|
142 |
|
143 |
== Changelog ==
|
144 |
+
= 1.2.2 =
|
145 |
+
* Added additional labels to Post Type Creator and Taxonomy Creator
|
146 |
+
* We now check the post type name to not have spaces, capital letters or hyphens
|
147 |
+
* When changing a custom post type name the existing posts get ported as well
|
148 |
+
|
149 |
= 1.2.1 =
|
150 |
* When renaming a taxonomy we now make sure the terms get ported as well
|
151 |
|
wck-cptc.php
CHANGED
@@ -27,7 +27,7 @@ function wck_cptc_print_scripts($hook){
|
|
27 |
/* create the meta box only for admins ( 'capability' => 'edit_theme_options' ) */
|
28 |
add_action( 'init', 'wck_cptc_create_box', 11 );
|
29 |
function wck_cptc_create_box(){
|
30 |
-
|
31 |
if( is_admin() && current_user_can( 'edit_theme_options' ) ){
|
32 |
/* get registered taxonomies */
|
33 |
$args = array(
|
@@ -66,19 +66,53 @@ function wck_cptc_create_box(){
|
|
66 |
array( 'type' => 'text', 'title' => __( 'Not Found In Trash', 'wck' ), 'slug' => 'not-found-in-trash', 'description' => __( 'ex. No Books found in Trash', 'wck' ) ),
|
67 |
array( 'type' => 'text', 'title' => __( 'Parent Item Colon', 'wck' ), 'slug' => 'parent-item-colon', 'description' => __( 'the parent text. This string isn\'t used on non-hierarchical types. In hierarchical ones the default is Parent Page ', 'wck' ) ),
|
68 |
array( 'type' => 'text', 'title' => __( 'Menu Name', 'wck' ), 'slug' => 'menu-name' ),
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
/* set up the box arguments */
|
84 |
$args = array(
|
@@ -100,7 +134,10 @@ function wck_cptc_create_box(){
|
|
100 |
add_action( 'init', 'wck_cptc_create_cpts', 8 );
|
101 |
|
102 |
function wck_cptc_create_cpts(){
|
|
|
|
|
103 |
$cpts = get_option('wck_cptc');
|
|
|
104 |
if( !empty( $cpts ) ){
|
105 |
foreach( $cpts as $cpt ){
|
106 |
|
@@ -119,6 +156,35 @@ function wck_cptc_create_cpts(){
|
|
119 |
'parent_item_colon' => __( !empty( $cpt['parent-item-colon'] ) ? $cpt['parent-item-colon'] : "Parent Page", 'wck' ),
|
120 |
'menu_name' => $cpt['menu-name'] ? $cpt['menu-name'] : $cpt['plural-label']
|
121 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
$args = array(
|
123 |
'labels' => $labels,
|
124 |
'public' => $cpt['public'] == 'false' ? false : true,
|
@@ -175,19 +241,19 @@ function wck_cptc_form_label_wrapper_start(){
|
|
175 |
echo '<li id="cptc-advanced-label-options-container" style="display:none;"><ul>';
|
176 |
}
|
177 |
|
178 |
-
add_action( "
|
179 |
function wck_cptc_form_label_wrapper_end(){
|
180 |
echo '</ul></li>';
|
181 |
}
|
182 |
|
183 |
/* advanced options container for add form */
|
184 |
-
add_action( "
|
185 |
function wck_cptc_form_wrapper_start(){
|
186 |
echo '<li><a href="javascript:void(0)" onclick="jQuery(\'#cptc-advanced-options-container\').toggle(); if( jQuery(this).text() == \''. __('Show Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\'Hide Advanced Options\'); else if( jQuery(this).text() == \''. __('Hide Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __('Show Advanced Options', 'wck' ) .'\');">'. __('Show Advanced Options', 'wck' ) .'</a></li>';
|
187 |
echo '<li id="cptc-advanced-options-container" style="display:none;"><ul>';
|
188 |
}
|
189 |
|
190 |
-
add_action( "
|
191 |
function wck_cptc_form_wrapper_end(){
|
192 |
echo '</ul></li>';
|
193 |
}
|
@@ -200,21 +266,21 @@ function wck_cptc_update_form_label_wrapper_start( $form, $i ){
|
|
200 |
return $form;
|
201 |
}
|
202 |
|
203 |
-
add_filter( "
|
204 |
function wck_cptc_update_form_label_wrapper_end( $form, $i ){
|
205 |
$form .= '</ul></li>';
|
206 |
return $form;
|
207 |
}
|
208 |
|
209 |
/* advanced options container for update form */
|
210 |
-
add_filter( "
|
211 |
function wck_cptc_update_form_wrapper_start( $form, $i ){
|
212 |
$form .= '<li><a href="javascript:void(0)" onclick="jQuery(\'#cptc-advanced-options-update-container-'.$i.'\').toggle(); if( jQuery(this).text() == \''. __( 'Show Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __( 'Hide Advanced Options', 'wck' ) .'\'); else if( jQuery(this).text() == \''. __( 'Hide Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __( 'Show Advanced Options', 'wck' ) .'\');">'. __( 'Show Advanced Options', 'wck' ) .'</a></li>';
|
213 |
$form .= '<li id="cptc-advanced-options-update-container-'.$i.'" style="display:none;"><ul>';
|
214 |
return $form;
|
215 |
}
|
216 |
|
217 |
-
add_filter( "
|
218 |
function wck_cptc_update_form_wrapper_end( $form, $i ){
|
219 |
$form .= '</ul></li>';
|
220 |
return $form;
|
@@ -229,21 +295,21 @@ function wck_cptc_display_label_wrapper_start( $form, $i ){
|
|
229 |
return $form;
|
230 |
}
|
231 |
|
232 |
-
add_filter( "
|
233 |
function wck_cptc_display_label_wrapper_end( $form, $i ){
|
234 |
$form .= '</ul></li>';
|
235 |
return $form;
|
236 |
}
|
237 |
|
238 |
/* advanced options container for display */
|
239 |
-
add_filter( "
|
240 |
function wck_cptc_display_adv_wrapper_start( $form, $i ){
|
241 |
$form .= '<li><a href="javascript:void(0)" onclick="jQuery(\'#cptc-advanced-options-display-container-'.$i.'\').toggle(); if( jQuery(this).text() == \''. __( 'Show Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __( 'Hide Advanced Options', 'wck' ) .'\'); else if( jQuery(this).text() == \''. __( 'Hide Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __( 'Show Advanced Options', 'wck' ) .'\');">'. __( 'Show Advanced Options', 'wck' ) .'</a></li>';
|
242 |
$form .= '<li id="cptc-advanced-options-display-container-'.$i.'" style="display:none;"><ul>';
|
243 |
return $form;
|
244 |
}
|
245 |
|
246 |
-
add_filter( "
|
247 |
function wck_cptc_display_adv_wrapper_end( $form, $i ){
|
248 |
$form .= '</ul></li>';
|
249 |
return $form;
|
@@ -327,4 +393,61 @@ function wck_cpt_make_sure_thumbnail_support_works(){
|
|
327 |
$_wp_theme_features["post-thumbnails"][0] = $post_types_with_thumbnails;
|
328 |
}
|
329 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
?>
|
27 |
/* create the meta box only for admins ( 'capability' => 'edit_theme_options' ) */
|
28 |
add_action( 'init', 'wck_cptc_create_box', 11 );
|
29 |
function wck_cptc_create_box(){
|
30 |
+
global $wp_version;
|
31 |
if( is_admin() && current_user_can( 'edit_theme_options' ) ){
|
32 |
/* get registered taxonomies */
|
33 |
$args = array(
|
66 |
array( 'type' => 'text', 'title' => __( 'Not Found In Trash', 'wck' ), 'slug' => 'not-found-in-trash', 'description' => __( 'ex. No Books found in Trash', 'wck' ) ),
|
67 |
array( 'type' => 'text', 'title' => __( 'Parent Item Colon', 'wck' ), 'slug' => 'parent-item-colon', 'description' => __( 'the parent text. This string isn\'t used on non-hierarchical types. In hierarchical ones the default is Parent Page ', 'wck' ) ),
|
68 |
array( 'type' => 'text', 'title' => __( 'Menu Name', 'wck' ), 'slug' => 'menu-name' ),
|
69 |
+
);
|
70 |
+
|
71 |
+
if( version_compare( $wp_version, '4.3', '>=' ) ) {
|
72 |
+
$labels_v43 = array(
|
73 |
+
array( 'type' => 'text', 'title' => __( 'Featured Image', 'wck' ), 'slug' => 'featured_image', 'description' => __( 'ex. Featured Image', 'wck' ) ),
|
74 |
+
array( 'type' => 'text', 'title' => __( 'Set Featured Image', 'wck' ), 'slug' => 'set_featured_image', 'description' => __( 'ex. Set Featured Image', 'wck' ) ),
|
75 |
+
array( 'type' => 'text', 'title' => __( 'Remove Featured Image', 'wck' ), 'slug' => 'remove_featured_image', 'description' => __( 'ex. Remove Featured Image', 'wck' ) ),
|
76 |
+
array( 'type' => 'text', 'title' => __( 'Use Featured Image', 'wck' ), 'slug' => 'use_featured_image', 'description' => __( 'ex. Use Featured Image', 'wck' ) )
|
77 |
+
);
|
78 |
+
|
79 |
+
foreach( $labels_v43 as $label_v43 ) {
|
80 |
+
array_push( $cpt_creation_fields, $label_v43 );
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
if( version_compare( $wp_version, '4.4', '>=' ) ) {
|
85 |
+
$labels_v44 = array(
|
86 |
+
array( 'type' => 'text', 'title' => __( 'Archives', 'wck' ), 'slug' => 'archives', 'description' => __( 'ex. Archives', 'wck' ) ),
|
87 |
+
array( 'type' => 'text', 'title' => __( 'Inser Into Item', 'wck' ), 'slug' => 'insert_into_item', 'description' => __( 'ex. Inser Into Item', 'wck' ) ),
|
88 |
+
array( 'type' => 'text', 'title' => __( 'Uploaded to this Item', 'wck' ), 'slug' => 'uploaded_to_this_item', 'description' => __( 'ex. Uploaded to this Item', 'wck' ) ),
|
89 |
+
array( 'type' => 'text', 'title' => __( 'Filter Items List', 'wck' ), 'slug' => 'filter_items_list', 'description' => __( 'ex. Filter Items List', 'wck' ) ),
|
90 |
+
array( 'type' => 'text', 'title' => __( 'Items List Navigation', 'wck' ), 'slug' => 'items_list_navigation', 'description' => __( 'ex. Items List Navigation', 'wck' ) ),
|
91 |
+
array( 'type' => 'text', 'title' => __( 'Items List', 'wck' ), 'slug' => 'items_list', 'description' => __( 'ex. Items List', 'wck' ) ),
|
92 |
+
);
|
93 |
+
|
94 |
+
foreach( $labels_v44 as $label_v44 ) {
|
95 |
+
array_push( $cpt_creation_fields, $label_v44 );
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
$cpt_creation_fields2 = array(
|
100 |
+
array( 'type' => 'select', 'title' => __( 'Public', 'wck' ), 'slug' => 'public', 'options' => array( 'false', 'true' ), 'default' => 'true', 'description' => __( 'Meta argument used to define default values for publicly_queriable, show_ui, show_in_nav_menus and exclude_from_search', 'wck' ) ),
|
101 |
+
array( 'type' => 'select', 'title' => __( 'Show UI', 'wck' ), 'slug' => 'show-ui', 'options' => array( 'false', 'true' ), 'default' => 'true', 'description' => __( 'Whether to generate a default UI for managing this post type.', 'wck' ) ),
|
102 |
+
array( 'type' => 'select', 'title' => __( 'Show In Nav Menus', 'wck' ), 'slug' => 'show-in-nav-menus', 'options' => array( 'false', 'true' ), 'default' => 'true', 'description' => __( 'Whether post_type is available for selection in navigation menus.', 'wck' ) ),
|
103 |
+
array( 'type' => 'text', 'title' => __( 'Show In Menu', 'wck' ), 'slug' => 'show-in-menu', 'default' => 'true', 'description' => __( 'Whether to show the post type in the admin menu. show_ui must be true. "false" - do not display in the admin menu, "true" - display as a top level menu, "some string" - If an existing top level page such as "tools.php" or "edit.php?post_type=page", the post type will be placed as a sub menu of that.', 'wck' ) ),
|
104 |
+
array( 'type' => 'text', 'title' => __( 'Menu Position', 'wck' ), 'slug' => 'menu-position', 'description' => __( 'The position in the menu order the post type should appear.', 'wck' ) ),
|
105 |
+
array( 'type' => 'text', 'title' => __( 'Menu Icon', 'wck' ), 'slug' => 'menu-icon', 'description' => __( 'The url to the icon to be used for this menu.', 'wck' ) ),
|
106 |
+
array( 'type' => 'text', 'title' => __( 'Capability Type', 'wck' ), 'slug' => 'capability-type', 'description' => __( 'The string to use to build the read, edit, and delete capabilities.', 'wck' ), 'default' => 'post' ),
|
107 |
+
array( 'type' => 'checkbox', 'title' => __( 'Taxonomies', 'wck' ), 'slug' => 'taxonomies', 'options' => $taxonomie_names ),
|
108 |
+
array( 'type' => 'select', 'title' => __( 'Rewrite', 'wck' ), 'slug' => 'rewrite', 'options' => array( 'false', 'true' ), 'default' => 'true', 'description' => __( 'Rewrite permalinks.', 'wck' ) ),
|
109 |
+
array( 'type' => 'text', 'title' => __( 'Rewrite Slug', 'wck' ), 'slug' => 'rewrite-slug', 'description' => __( 'Defaults to post type name.', 'wck' ) ),
|
110 |
+
array( 'type' => 'select', 'title' => __( 'Show in REST API', 'wck'), 'slug' => 'show-in-rest', 'options' => array( 'false', 'true'), 'default' => 'false', 'description' => __('Make this post type available via WP REST API ', 'wck' ) )
|
111 |
+
);
|
112 |
+
|
113 |
+
foreach( $cpt_creation_fields2 as $cpt_creation_field ) {
|
114 |
+
array_push( $cpt_creation_fields, $cpt_creation_field );
|
115 |
+
}
|
116 |
|
117 |
/* set up the box arguments */
|
118 |
$args = array(
|
134 |
add_action( 'init', 'wck_cptc_create_cpts', 8 );
|
135 |
|
136 |
function wck_cptc_create_cpts(){
|
137 |
+
global $wp_version;
|
138 |
+
|
139 |
$cpts = get_option('wck_cptc');
|
140 |
+
|
141 |
if( !empty( $cpts ) ){
|
142 |
foreach( $cpts as $cpt ){
|
143 |
|
156 |
'parent_item_colon' => __( !empty( $cpt['parent-item-colon'] ) ? $cpt['parent-item-colon'] : "Parent Page", 'wck' ),
|
157 |
'menu_name' => $cpt['menu-name'] ? $cpt['menu-name'] : $cpt['plural-label']
|
158 |
);
|
159 |
+
|
160 |
+
if( version_compare( $wp_version, '4.3', '>=' ) ) {
|
161 |
+
$labels_v43 = array(
|
162 |
+
'featured_image' => __( !empty( $cpt['featured_image'] ) ? $cpt['featured_image'] : "Featured Image" ),
|
163 |
+
'set_featured_image' => __( !empty( $cpt['set_featured_image'] ) ? $cpt['set_featured_image'] : "Set featured image" ),
|
164 |
+
'remove_featured_image' => __( !empty( $cpt['remove_featured_image'] ) ? $cpt['remove_featured_image'] : "Remove featured image" ),
|
165 |
+
'use_featured_image' => __( !empty( $cpt['use_featured_image'] ) ? $cpt['use_featured_image'] : "Use as featured image" )
|
166 |
+
);
|
167 |
+
|
168 |
+
foreach( $labels_v43 as $label_v43 ) {
|
169 |
+
array_push( $labels, $label_v43 );
|
170 |
+
}
|
171 |
+
}
|
172 |
+
|
173 |
+
if( version_compare( $wp_version, '4.4', '>=' ) ) {
|
174 |
+
$labels_v44 = array(
|
175 |
+
'archives' => __( !empty( $cpt['archives'] ) ? $cpt['archives'] : $cpt['singular-label'] . " Archives" ),
|
176 |
+
'insert_into_item' => __( !empty( $cpt['insert_into_item'] ) ? $cpt['insert_into_item'] : "Insert Into " . $cpt['singular-label'] ),
|
177 |
+
'uploaded_to_this_item' => __( !empty( $cpt['uploaded_to_this_item'] ) ? $cpt['uploaded_to_this_item'] : "Uploaded to this " . $cpt['singular-label'] ),
|
178 |
+
'filter_items_list' => __( !empty( $cpt['filter_items_list'] ) ? $cpt['filter_items_list'] : "Filter Items List" ),
|
179 |
+
'items_list_navigation' => __( !empty( $cpt['items_list_navigation'] ) ? $cpt['items_list_navigation'] : "Items List Navigation" ),
|
180 |
+
'items_list' => __( !empty( $cpt['items_list'] ) ? $cpt['items_list'] : "Items List" )
|
181 |
+
);
|
182 |
+
|
183 |
+
foreach( $labels_v44 as $label_v44 ) {
|
184 |
+
array_push( $labels, $label_v44 );
|
185 |
+
}
|
186 |
+
}
|
187 |
+
|
188 |
$args = array(
|
189 |
'labels' => $labels,
|
190 |
'public' => $cpt['public'] == 'false' ? false : true,
|
241 |
echo '<li id="cptc-advanced-label-options-container" style="display:none;"><ul>';
|
242 |
}
|
243 |
|
244 |
+
add_action( "wck_after_add_form_wck_cptc_element_27", 'wck_cptc_form_label_wrapper_end' );
|
245 |
function wck_cptc_form_label_wrapper_end(){
|
246 |
echo '</ul></li>';
|
247 |
}
|
248 |
|
249 |
/* advanced options container for add form */
|
250 |
+
add_action( "wck_before_add_form_wck_cptc_element_28", 'wck_cptc_form_wrapper_start' );
|
251 |
function wck_cptc_form_wrapper_start(){
|
252 |
echo '<li><a href="javascript:void(0)" onclick="jQuery(\'#cptc-advanced-options-container\').toggle(); if( jQuery(this).text() == \''. __('Show Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\'Hide Advanced Options\'); else if( jQuery(this).text() == \''. __('Hide Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __('Show Advanced Options', 'wck' ) .'\');">'. __('Show Advanced Options', 'wck' ) .'</a></li>';
|
253 |
echo '<li id="cptc-advanced-options-container" style="display:none;"><ul>';
|
254 |
}
|
255 |
|
256 |
+
add_action( "wck_after_add_form_wck_cptc_element_38", 'wck_cptc_form_wrapper_end' );
|
257 |
function wck_cptc_form_wrapper_end(){
|
258 |
echo '</ul></li>';
|
259 |
}
|
266 |
return $form;
|
267 |
}
|
268 |
|
269 |
+
add_filter( "wck_after_update_form_wck_cptc_element_27", 'wck_cptc_update_form_label_wrapper_end', 10, 2 );
|
270 |
function wck_cptc_update_form_label_wrapper_end( $form, $i ){
|
271 |
$form .= '</ul></li>';
|
272 |
return $form;
|
273 |
}
|
274 |
|
275 |
/* advanced options container for update form */
|
276 |
+
add_filter( "wck_before_update_form_wck_cptc_element_28", 'wck_cptc_update_form_wrapper_start', 10, 2 );
|
277 |
function wck_cptc_update_form_wrapper_start( $form, $i ){
|
278 |
$form .= '<li><a href="javascript:void(0)" onclick="jQuery(\'#cptc-advanced-options-update-container-'.$i.'\').toggle(); if( jQuery(this).text() == \''. __( 'Show Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __( 'Hide Advanced Options', 'wck' ) .'\'); else if( jQuery(this).text() == \''. __( 'Hide Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __( 'Show Advanced Options', 'wck' ) .'\');">'. __( 'Show Advanced Options', 'wck' ) .'</a></li>';
|
279 |
$form .= '<li id="cptc-advanced-options-update-container-'.$i.'" style="display:none;"><ul>';
|
280 |
return $form;
|
281 |
}
|
282 |
|
283 |
+
add_filter( "wck_after_update_form_wck_cptc_element_38", 'wck_cptc_update_form_wrapper_end', 10, 2 );
|
284 |
function wck_cptc_update_form_wrapper_end( $form, $i ){
|
285 |
$form .= '</ul></li>';
|
286 |
return $form;
|
295 |
return $form;
|
296 |
}
|
297 |
|
298 |
+
add_filter( "wck_after_listed_wck_cptc_element_27", 'wck_cptc_display_label_wrapper_end', 10, 2 );
|
299 |
function wck_cptc_display_label_wrapper_end( $form, $i ){
|
300 |
$form .= '</ul></li>';
|
301 |
return $form;
|
302 |
}
|
303 |
|
304 |
/* advanced options container for display */
|
305 |
+
add_filter( "wck_before_listed_wck_cptc_element_28", 'wck_cptc_display_adv_wrapper_start', 10, 2 );
|
306 |
function wck_cptc_display_adv_wrapper_start( $form, $i ){
|
307 |
$form .= '<li><a href="javascript:void(0)" onclick="jQuery(\'#cptc-advanced-options-display-container-'.$i.'\').toggle(); if( jQuery(this).text() == \''. __( 'Show Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __( 'Hide Advanced Options', 'wck' ) .'\'); else if( jQuery(this).text() == \''. __( 'Hide Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __( 'Show Advanced Options', 'wck' ) .'\');">'. __( 'Show Advanced Options', 'wck' ) .'</a></li>';
|
308 |
$form .= '<li id="cptc-advanced-options-display-container-'.$i.'" style="display:none;"><ul>';
|
309 |
return $form;
|
310 |
}
|
311 |
|
312 |
+
add_filter( "wck_after_listed_wck_cptc_element_38", 'wck_cptc_display_adv_wrapper_end', 10, 2 );
|
313 |
function wck_cptc_display_adv_wrapper_end( $form, $i ){
|
314 |
$form .= '</ul></li>';
|
315 |
return $form;
|
393 |
$_wp_theme_features["post-thumbnails"][0] = $post_types_with_thumbnails;
|
394 |
}
|
395 |
}
|
396 |
+
|
397 |
+
/* when renaming a post type make sure the posts get ported as well */
|
398 |
+
add_action( 'wck_before_update_meta', 'wck_cptc_update_post_type', 10, 4 );
|
399 |
+
function wck_cptc_update_post_type( $meta, $id, $values, $element_id ){
|
400 |
+
if( $meta == 'wck_cptc' ){
|
401 |
+
$old_values = get_option( $meta );
|
402 |
+
if( !empty( $old_values[$element_id] ) ){
|
403 |
+
if( $old_values[$element_id]['post-type'] != $values['post-type'] ){
|
404 |
+
global $wpdb;
|
405 |
+
$wpdb->update(
|
406 |
+
$wpdb->posts,
|
407 |
+
array(
|
408 |
+
'post_type' => $values['post-type'], // string
|
409 |
+
),
|
410 |
+
array( 'post_type' => $old_values[$element_id]['post-type'] ),
|
411 |
+
array(
|
412 |
+
'%s',
|
413 |
+
)
|
414 |
+
);
|
415 |
+
}
|
416 |
+
}
|
417 |
+
}
|
418 |
+
}
|
419 |
+
|
420 |
+
/* Post Type Name Verification */
|
421 |
+
add_filter( 'wck_required_test_wck_cptc_post-type', 'wck_cptc_check_post_type', 10, 3 );
|
422 |
+
function wck_cptc_check_post_type( $bool, $value, $post_id ){
|
423 |
+
//Make sure it doesn't contain capital letters or spaces
|
424 |
+
$no_spaces_value = str_replace(' ', '', $value);
|
425 |
+
$no_hyphens_value = str_replace('-', '', $value);
|
426 |
+
$lowercase_value = strtolower($value);
|
427 |
+
|
428 |
+
if ( ( $no_spaces_value == $value ) && ( $lowercase_value == $value ) && ( $no_hyphens_value == $value ) )
|
429 |
+
$checked = false;
|
430 |
+
else
|
431 |
+
$checked = true;
|
432 |
+
|
433 |
+
return ( empty($value) || $checked );
|
434 |
+
}
|
435 |
+
|
436 |
+
add_filter( 'wck_required_message_wck_cptc_post-type', 'wck_cptc_change_post_type_message', 10, 2 );
|
437 |
+
function wck_cptc_change_post_type_message( $message, $value ){
|
438 |
+
// change error message
|
439 |
+
$no_spaces_value = str_replace(' ', '', $value);
|
440 |
+
$no_hyphens_value = str_replace('-', '', $value);
|
441 |
+
$lowercase_value = strtolower($value);
|
442 |
+
|
443 |
+
if( empty( $value ) )
|
444 |
+
return $message;
|
445 |
+
else if( $no_spaces_value != $value )
|
446 |
+
return __("Post Type name must not contain any spaces\n", "wck" );
|
447 |
+
else if ($lowercase_value != $value)
|
448 |
+
return __( "Post Type name must not contain any capital letters\n", "wck" );
|
449 |
+
else if ($no_hyphens_value != $value)
|
450 |
+
return __( "Post Type name must not contain any hyphens\n", "wck" );
|
451 |
+
}
|
452 |
+
|
453 |
?>
|
wck-ctc.php
CHANGED
@@ -17,7 +17,7 @@ new WCK_Page_Creator( $args );
|
|
17 |
/* create the meta box only for admins ( 'capability' => 'edit_theme_options' ) */
|
18 |
add_action( 'init', 'wck_ctc_create_box', 11 );
|
19 |
function wck_ctc_create_box(){
|
20 |
-
|
21 |
if( is_admin() && current_user_can( 'edit_theme_options' ) ){
|
22 |
$args = array(
|
23 |
'public' => true
|
@@ -53,14 +53,37 @@ function wck_ctc_create_box(){
|
|
53 |
array( 'type' => 'text', 'title' => __( 'Add Or Remove Items', 'wck' ), 'slug' => 'add-or-remove-items', 'description' => __( 'ex. Add or remove writers', 'wck' ) ),
|
54 |
array( 'type' => 'text', 'title' => __( 'Choose From Most Used', 'wck' ), 'slug' => 'choose-from-most-used', 'description' => __( 'ex. Choose from the most used writers', 'wck' ) ),
|
55 |
array( 'type' => 'text', 'title' => __( 'Menu Name', 'wck' ), 'slug' => 'menu-name' ),
|
56 |
-
|
57 |
-
array( 'type' => 'select', 'title' => __( 'Public', 'wck' ), 'slug' => 'public', 'options' => array( 'false', 'true' ), 'default' => 'true', 'description' => __( 'Meta argument used to define default values for publicly_queriable, show_ui, show_in_nav_menus and exclude_from_search', 'wck' ) ),
|
58 |
-
array( 'type' => 'select', 'title' => __( 'Show UI', 'wck' ), 'slug' => 'show-ui', 'options' => array( 'false', 'true' ), 'default' => 'true', 'description' => __( 'Whether to generate a default UI for managing this post type.', 'wck' ) ),
|
59 |
-
array( 'type' => 'select', 'title' => __( 'Show Tagcloud', 'wck' ), 'slug' => 'show-tagcloud', 'options' => array( 'false', 'true' ), 'default' => 'true', 'description' => __( 'Whether to allow the Tag Cloud widget to use this taxonomy.', 'wck' ) ),
|
60 |
-
array( 'type' => 'select', 'title' => __( 'Show Admin Column', 'wck' ), 'slug' => 'show-admin-column', 'options' => array( 'false', 'true' ), 'default' => 'false', 'description' => __( 'Whether to allow automatic creation of taxonomy columns on associated post-types.', 'wck' ) ),
|
61 |
-
array( 'type' => 'select', 'title' => __( 'Show in REST API', 'wck'), 'slug' => 'show-in-rest', 'options' => array( 'false', 'true'), 'default' => 'false', 'description' => __('Make this taxonomy available via WP REST API ', 'wck' ) )
|
62 |
);
|
63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
$args = array(
|
65 |
'metabox_id' => 'ctc_creation_box',
|
66 |
'metabox_title' => __( 'Custom Taxonomy Creation', 'wck' ),
|
@@ -79,6 +102,7 @@ function wck_ctc_create_box(){
|
|
79 |
add_action( 'init', 'wck_ctc_create_taxonomy', 8 );
|
80 |
|
81 |
function wck_ctc_create_taxonomy(){
|
|
|
82 |
$cts = get_option('wck_ctc');
|
83 |
if( !empty( $cts ) ){
|
84 |
foreach( $cts as $ct ){
|
@@ -101,6 +125,23 @@ function wck_ctc_create_taxonomy(){
|
|
101 |
'menu_name' => $ct['menu-name'] ? $ct['menu-name'] : $ct['plural-label']
|
102 |
);
|
103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
$args = array(
|
105 |
'labels' => $labels,
|
106 |
'public' => $ct['public'] == 'false' ? false : true,
|
@@ -177,19 +218,19 @@ function wck_ctc_form_label_wrapper_start(){
|
|
177 |
echo '<li id="ctc-advanced-label-options-container" style="display:none;"><ul>';
|
178 |
}
|
179 |
|
180 |
-
add_action( "
|
181 |
function wck_ctc_form_label_wrapper_end(){
|
182 |
echo '</ul></li>';
|
183 |
}
|
184 |
|
185 |
/* advanced options container for add form */
|
186 |
-
add_action( "
|
187 |
function wck_ctc_form_wrapper_start(){
|
188 |
echo '<li><a href="javascript:void(0)" onclick="jQuery(\'#ctc-advanced-options-container\').toggle(); if( jQuery(this).text() == \''. __( 'Show Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __( 'Hide Advanced Options', 'wck' ) .'\'); else if( jQuery(this).text() == \''. __( 'Hide Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __( 'Show Advanced Options', 'wck' ) .'\');">'. __( 'Show Advanced Options', 'wck' ) .'</a></li>';
|
189 |
echo '<li id="ctc-advanced-options-container" style="display:none;"><ul>';
|
190 |
}
|
191 |
|
192 |
-
add_action( "
|
193 |
function wck_ctc_form_wrapper_end(){
|
194 |
echo '</ul></li>';
|
195 |
}
|
@@ -202,21 +243,21 @@ function wck_ctc_update_form_label_wrapper_start( $form, $i ){
|
|
202 |
return $form;
|
203 |
}
|
204 |
|
205 |
-
add_filter( "
|
206 |
function wck_ctc_update_form_label_wrapper_end( $form, $i ){
|
207 |
$form .= '</ul></li>';
|
208 |
return $form;
|
209 |
}
|
210 |
|
211 |
/* advanced options container for update form */
|
212 |
-
add_filter( "
|
213 |
function wck_ctc_update_form_wrapper_start( $form, $i ){
|
214 |
$form .= '<li><a href="javascript:void(0)" onclick="jQuery(\'#ctc-advanced-options-update-container-'.$i.'\').toggle(); if( jQuery(this).text() == \''. __( 'Show Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __( 'Hide Advanced Options', 'wck' ) .'\'); else if( jQuery(this).text() == \''. __( 'Hide Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __( 'Show Advanced Options', 'wck' ) .'\');">'. __( 'Show Advanced Options', 'wck' ) .'</a></li>';
|
215 |
$form .= '<li id="ctc-advanced-options-update-container-'.$i.'" style="display:none;"><ul>';
|
216 |
return $form;
|
217 |
}
|
218 |
|
219 |
-
add_filter( "
|
220 |
function wck_ctc_update_form_wrapper_end( $form, $i ){
|
221 |
$form .= '</ul></li>';
|
222 |
return $form;
|
@@ -231,21 +272,21 @@ function wck_ctc_display_label_wrapper_start( $form, $i ){
|
|
231 |
return $form;
|
232 |
}
|
233 |
|
234 |
-
add_filter( "
|
235 |
function wck_ctc_display_label_wrapper_end( $form, $i ){
|
236 |
$form .= '</ul></li>';
|
237 |
return $form;
|
238 |
}
|
239 |
|
240 |
/* advanced options container for display */
|
241 |
-
add_filter( "
|
242 |
function wck_ctc_display_adv_wrapper_start( $form, $i ){
|
243 |
$form .= '<li><a href="javascript:void(0)" onclick="jQuery(\'#ctc-advanced-options-display-container-'.$i.'\').toggle(); if( jQuery(this).text() == \''. __( 'Show Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __( 'Hide Advanced Options', 'wck' ) .'\'); else if( jQuery(this).text() == \''. __( 'Hide Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __( 'Show Advanced Options', 'wck' ) .'\');">'. __( 'Show Advanced Options', 'wck' ) .'</a></li>';
|
244 |
$form .= '<li id="ctc-advanced-options-display-container-'.$i.'" style="display:none;"><ul>';
|
245 |
return $form;
|
246 |
}
|
247 |
|
248 |
-
add_filter( "
|
249 |
function wck_ctc_display_adv_wrapper_end( $form, $i ){
|
250 |
$form .= '</ul></li>';
|
251 |
return $form;
|
17 |
/* create the meta box only for admins ( 'capability' => 'edit_theme_options' ) */
|
18 |
add_action( 'init', 'wck_ctc_create_box', 11 );
|
19 |
function wck_ctc_create_box(){
|
20 |
+
global $wp_version;
|
21 |
if( is_admin() && current_user_can( 'edit_theme_options' ) ){
|
22 |
$args = array(
|
23 |
'public' => true
|
53 |
array( 'type' => 'text', 'title' => __( 'Add Or Remove Items', 'wck' ), 'slug' => 'add-or-remove-items', 'description' => __( 'ex. Add or remove writers', 'wck' ) ),
|
54 |
array( 'type' => 'text', 'title' => __( 'Choose From Most Used', 'wck' ), 'slug' => 'choose-from-most-used', 'description' => __( 'ex. Choose from the most used writers', 'wck' ) ),
|
55 |
array( 'type' => 'text', 'title' => __( 'Menu Name', 'wck' ), 'slug' => 'menu-name' ),
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
);
|
57 |
|
58 |
+
if( version_compare( $wp_version, '4.3', '>=' ) ) {
|
59 |
+
$label_v43 = array( 'type' => 'text', 'title' => __( 'No Terms', 'wck' ), 'slug' => 'no_terms', 'description' => __( 'ex. No Terms', 'wck' ) );
|
60 |
+
|
61 |
+
array_push( $ct_creation_fields, $label_v43 );
|
62 |
+
}
|
63 |
+
|
64 |
+
if( version_compare( $wp_version, '4.4', '>=' ) ) {
|
65 |
+
$labels_v44 = array(
|
66 |
+
array( 'type' => 'text', 'title' => __( 'Items List Navigation', 'wck' ), 'slug' => 'items_list_navigation', 'description' => __( 'ex. Items List Navigation', 'wck' ) ),
|
67 |
+
array( 'type' => 'text', 'title' => __( 'Items List', 'wck' ), 'slug' => 'items_list', 'description' => __( 'ex. Items List', 'wck' ) ),
|
68 |
+
);
|
69 |
+
|
70 |
+
foreach( $labels_v44 as $label_v44 ) {
|
71 |
+
array_push( $ct_creation_fields, $label_v44 );
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
$ct_creation_fields2 = array(
|
76 |
+
array( 'type' => 'select', 'title' => __( 'Public', 'wck' ), 'slug' => 'public', 'options' => array( 'false', 'true' ), 'default' => 'true', 'description' => __( 'Meta argument used to define default values for publicly_queriable, show_ui, show_in_nav_menus and exclude_from_search', 'wck' ) ),
|
77 |
+
array( 'type' => 'select', 'title' => __( 'Show UI', 'wck' ), 'slug' => 'show-ui', 'options' => array( 'false', 'true' ), 'default' => 'true', 'description' => __( 'Whether to generate a default UI for managing this post type.', 'wck' ) ),
|
78 |
+
array( 'type' => 'select', 'title' => __( 'Show Tagcloud', 'wck' ), 'slug' => 'show-tagcloud', 'options' => array( 'false', 'true' ), 'default' => 'true', 'description' => __( 'Whether to allow the Tag Cloud widget to use this taxonomy.', 'wck' ) ),
|
79 |
+
array( 'type' => 'select', 'title' => __( 'Show Admin Column', 'wck' ), 'slug' => 'show-admin-column', 'options' => array( 'false', 'true' ), 'default' => 'false', 'description' => __( 'Whether to allow automatic creation of taxonomy columns on associated post-types.', 'wck' ) ),
|
80 |
+
array( 'type' => 'select', 'title' => __( 'Show in REST API', 'wck'), 'slug' => 'show-in-rest', 'options' => array( 'false', 'true'), 'default' => 'false', 'description' => __('Make this taxonomy available via WP REST API ', 'wck' ) )
|
81 |
+
);
|
82 |
+
|
83 |
+
foreach( $ct_creation_fields2 as $ct_creation_field ) {
|
84 |
+
array_push( $ct_creation_fields, $ct_creation_field );
|
85 |
+
}
|
86 |
+
|
87 |
$args = array(
|
88 |
'metabox_id' => 'ctc_creation_box',
|
89 |
'metabox_title' => __( 'Custom Taxonomy Creation', 'wck' ),
|
102 |
add_action( 'init', 'wck_ctc_create_taxonomy', 8 );
|
103 |
|
104 |
function wck_ctc_create_taxonomy(){
|
105 |
+
global $wp_version;
|
106 |
$cts = get_option('wck_ctc');
|
107 |
if( !empty( $cts ) ){
|
108 |
foreach( $cts as $ct ){
|
125 |
'menu_name' => $ct['menu-name'] ? $ct['menu-name'] : $ct['plural-label']
|
126 |
);
|
127 |
|
128 |
+
if( version_compare( $wp_version, '4.3', '>=' ) ) {
|
129 |
+
$labels_v43 = array( 'no_terms' => __( !empty( $ct['no_terms'] ) ? $ct['no_terms'] : "No Terms" ) );
|
130 |
+
|
131 |
+
array_push( $labels, $labels_v43 );
|
132 |
+
}
|
133 |
+
|
134 |
+
if( version_compare( $wp_version, '4.4', '>=' ) ) {
|
135 |
+
$labels_v44 = array(
|
136 |
+
'items_list_navigation' => __( !empty( $ct['items_list_navigation'] ) ? $ct['items_list_navigation'] : "Items List Navigation" ),
|
137 |
+
'items_list' => __( !empty( $ct['items_list'] ) ? $ct['items_list'] : "Items List" )
|
138 |
+
);
|
139 |
+
|
140 |
+
foreach( $labels_v44 as $label_v44 ) {
|
141 |
+
array_push( $labels, $label_v44 );
|
142 |
+
}
|
143 |
+
}
|
144 |
+
|
145 |
$args = array(
|
146 |
'labels' => $labels,
|
147 |
'public' => $ct['public'] == 'false' ? false : true,
|
218 |
echo '<li id="ctc-advanced-label-options-container" style="display:none;"><ul>';
|
219 |
}
|
220 |
|
221 |
+
add_action( "wck_after_add_form_wck_ctc_element_20", 'wck_ctc_form_label_wrapper_end' );
|
222 |
function wck_ctc_form_label_wrapper_end(){
|
223 |
echo '</ul></li>';
|
224 |
}
|
225 |
|
226 |
/* advanced options container for add form */
|
227 |
+
add_action( "wck_before_add_form_wck_ctc_element_21", 'wck_ctc_form_wrapper_start' );
|
228 |
function wck_ctc_form_wrapper_start(){
|
229 |
echo '<li><a href="javascript:void(0)" onclick="jQuery(\'#ctc-advanced-options-container\').toggle(); if( jQuery(this).text() == \''. __( 'Show Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __( 'Hide Advanced Options', 'wck' ) .'\'); else if( jQuery(this).text() == \''. __( 'Hide Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __( 'Show Advanced Options', 'wck' ) .'\');">'. __( 'Show Advanced Options', 'wck' ) .'</a></li>';
|
230 |
echo '<li id="ctc-advanced-options-container" style="display:none;"><ul>';
|
231 |
}
|
232 |
|
233 |
+
add_action( "wck_after_add_form_wck_ctc_element_25", 'wck_ctc_form_wrapper_end' );
|
234 |
function wck_ctc_form_wrapper_end(){
|
235 |
echo '</ul></li>';
|
236 |
}
|
243 |
return $form;
|
244 |
}
|
245 |
|
246 |
+
add_filter( "wck_after_update_form_wck_ctc_element_20", 'wck_ctc_update_form_label_wrapper_end', 10, 2 );
|
247 |
function wck_ctc_update_form_label_wrapper_end( $form, $i ){
|
248 |
$form .= '</ul></li>';
|
249 |
return $form;
|
250 |
}
|
251 |
|
252 |
/* advanced options container for update form */
|
253 |
+
add_filter( "wck_before_update_form_wck_ctc_element_21", 'wck_ctc_update_form_wrapper_start', 10, 2 );
|
254 |
function wck_ctc_update_form_wrapper_start( $form, $i ){
|
255 |
$form .= '<li><a href="javascript:void(0)" onclick="jQuery(\'#ctc-advanced-options-update-container-'.$i.'\').toggle(); if( jQuery(this).text() == \''. __( 'Show Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __( 'Hide Advanced Options', 'wck' ) .'\'); else if( jQuery(this).text() == \''. __( 'Hide Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __( 'Show Advanced Options', 'wck' ) .'\');">'. __( 'Show Advanced Options', 'wck' ) .'</a></li>';
|
256 |
$form .= '<li id="ctc-advanced-options-update-container-'.$i.'" style="display:none;"><ul>';
|
257 |
return $form;
|
258 |
}
|
259 |
|
260 |
+
add_filter( "wck_after_update_form_wck_ctc_element_25", 'wck_ctc_update_form_wrapper_end', 10, 2 );
|
261 |
function wck_ctc_update_form_wrapper_end( $form, $i ){
|
262 |
$form .= '</ul></li>';
|
263 |
return $form;
|
272 |
return $form;
|
273 |
}
|
274 |
|
275 |
+
add_filter( "wck_after_listed_wck_ctc_element_20", 'wck_ctc_display_label_wrapper_end', 10, 2 );
|
276 |
function wck_ctc_display_label_wrapper_end( $form, $i ){
|
277 |
$form .= '</ul></li>';
|
278 |
return $form;
|
279 |
}
|
280 |
|
281 |
/* advanced options container for display */
|
282 |
+
add_filter( "wck_before_listed_wck_ctc_element_21", 'wck_ctc_display_adv_wrapper_start', 10, 2 );
|
283 |
function wck_ctc_display_adv_wrapper_start( $form, $i ){
|
284 |
$form .= '<li><a href="javascript:void(0)" onclick="jQuery(\'#ctc-advanced-options-display-container-'.$i.'\').toggle(); if( jQuery(this).text() == \''. __( 'Show Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __( 'Hide Advanced Options', 'wck' ) .'\'); else if( jQuery(this).text() == \''. __( 'Hide Advanced Options', 'wck' ) .'\' ) jQuery(this).text(\''. __( 'Show Advanced Options', 'wck' ) .'\');">'. __( 'Show Advanced Options', 'wck' ) .'</a></li>';
|
285 |
$form .= '<li id="ctc-advanced-options-display-container-'.$i.'" style="display:none;"><ul>';
|
286 |
return $form;
|
287 |
}
|
288 |
|
289 |
+
add_filter( "wck_after_listed_wck_ctc_element_25", 'wck_ctc_display_adv_wrapper_end', 10, 2 );
|
290 |
function wck_ctc_display_adv_wrapper_end( $form, $i ){
|
291 |
$form .= '</ul></li>';
|
292 |
return $form;
|
wck.php
CHANGED
@@ -3,13 +3,13 @@
|
|
3 |
Plugin Name: WCK - Custom Fields and Custom Post Types Creator
|
4 |
Description: WordPress Creation Kit consists of three tools that can help you create and maintain custom post types, custom taxonomies and most importantly, custom fields and metaboxes for your posts, pages or CPT's.
|
5 |
Author: Cozmoslabs, Madalin Ungureanu, Cristian Antohe
|
6 |
-
Version: 1.2.
|
7 |
Author URI: http://www.cozmoslabs.com
|
8 |
|
9 |
License: GPL2
|
10 |
|
11 |
== Copyright ==
|
12 |
-
Copyright
|
13 |
|
14 |
This program is free software; you can redistribute it and/or modify
|
15 |
it under the terms of the GNU General Public License as published by
|
3 |
Plugin Name: WCK - Custom Fields and Custom Post Types Creator
|
4 |
Description: WordPress Creation Kit consists of three tools that can help you create and maintain custom post types, custom taxonomies and most importantly, custom fields and metaboxes for your posts, pages or CPT's.
|
5 |
Author: Cozmoslabs, Madalin Ungureanu, Cristian Antohe
|
6 |
+
Version: 1.2.2
|
7 |
Author URI: http://www.cozmoslabs.com
|
8 |
|
9 |
License: GPL2
|
10 |
|
11 |
== Copyright ==
|
12 |
+
Copyright 2016 Cozmoslabs (wwww.cozmoslabs.com)
|
13 |
|
14 |
This program is free software; you can redistribute it and/or modify
|
15 |
it under the terms of the GNU General Public License as published by
|