Custom Post Types and Custom Fields creator – WCK - Version 1.2.1

Version Description

  • When renaming a taxonomy we now make sure the terms get ported as well
Download this release

Release Info

Developer madalin.ungureanu
Plugin Icon 128x128 Custom Post Types and Custom Fields creator – WCK
Version 1.2.1
Comparing to
See all releases

Code changes from version 1.2.0 to 1.2.1

readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: custom fields, custom field, wordpress custom fields, advanced custom fiel
6
 
7
  Requires at least: 3.1
8
  Tested up to: 4.4.2
9
- Stable tag: 1.2.0
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,9 @@ Creating a taxonomy generally automatically creates a special query variable usi
141
  10. Taxonomy listing
142
 
143
  == Changelog ==
 
 
 
144
  = 1.2.0 =
145
  * We now display error message when meta name contains uppercase letters
146
  * We now display error message when taxonomy name contains uppercase letters or spaces
6
 
7
  Requires at least: 3.1
8
  Tested up to: 4.4.2
9
+ Stable tag: 1.2.1
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.1 =
145
+ * When renaming a taxonomy we now make sure the terms get ported as well
146
+
147
  = 1.2.0 =
148
  * We now display error message when meta name contains uppercase letters
149
  * We now display error message when taxonomy name contains uppercase letters or spaces
wck-ctc.php CHANGED
@@ -67,7 +67,8 @@ function wck_ctc_create_box(){
67
  'post_type' => 'ctc-page',
68
  'meta_name' => 'wck_ctc',
69
  'meta_array' => $ct_creation_fields,
70
- 'context' => 'option'
 
71
  );
72
 
73
 
@@ -299,4 +300,29 @@ function wck_ctc_help () {
299
  'content' => '<p>' . __( 'The Advanced Options are set to the most common defaults for taxonomies. To display them click the "Show Advanced Options" link.', 'wck' ) . '</p>',
300
  ) );
301
  }
302
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  'post_type' => 'ctc-page',
68
  'meta_name' => 'wck_ctc',
69
  'meta_array' => $ct_creation_fields,
70
+ 'context' => 'option',
71
+ 'sortable' => false
72
  );
73
 
74
 
300
  'content' => '<p>' . __( 'The Advanced Options are set to the most common defaults for taxonomies. To display them click the "Show Advanced Options" link.', 'wck' ) . '</p>',
301
  ) );
302
  }
303
+
304
+
305
+ /* when renaming a taxonomy make sure the terms get ported as well */
306
+ add_action( 'wck_before_update_meta', 'wck_ctc_update_taxonomies', 10, 4 );
307
+ function wck_ctc_update_taxonomies( $meta, $id, $values, $element_id ){
308
+ if( $meta == 'wck_ctc' ){
309
+ $old_values = get_option( $meta );
310
+ if( !empty( $old_values[$element_id] ) ){
311
+ if( $old_values[$element_id]['taxonomy'] != $values['taxonomy'] ){
312
+ global $wpdb;
313
+ $wpdb->update(
314
+ $wpdb->term_taxonomy,
315
+ array(
316
+ 'taxonomy' => $values['taxonomy'], // string
317
+ ),
318
+ array( 'taxonomy' => $old_values[$element_id]['taxonomy'] ),
319
+ array(
320
+ '%s',
321
+ )
322
+ );
323
+ }
324
+ }
325
+ }
326
+ }
327
+
328
+
wck.php CHANGED
@@ -3,7 +3,7 @@
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.0
7
  Author URI: http://www.cozmoslabs.com
8
 
9
  License: GPL2
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.1
7
  Author URI: http://www.cozmoslabs.com
8
 
9
  License: GPL2
wordpress-creation-kit-api/wck-fep/wck-fep.php CHANGED
@@ -181,8 +181,11 @@ class WCK_FrontEnd_Posting extends Wordpress_Creation_Kit{
181
  $post_id = $_GET['post_id'];
182
  else
183
  $post_id = '';
184
-
185
- $output .= "<script type='text/javascript'>
 
 
 
186
  jQuery.post( wckAjaxurl, { action:'wck_fep_create_frontend_form_".$form_name."', action_type:'".$action."', post_id:'".$post_id."' ". $loginerror ."}, function(response) {
187
  jQuery('.fep-container.".$form_name."').html(response);
188
  jQuery( '#fep-ajax-loading' ).remove();
181
  $post_id = $_GET['post_id'];
182
  else
183
  $post_id = '';
184
+
185
+ /* make sure we have jquery at this point */
186
+ wp_print_scripts( 'jquery' );
187
+
188
+ $output .= "<script type='text/javascript'>
189
  jQuery.post( wckAjaxurl, { action:'wck_fep_create_frontend_form_".$form_name."', action_type:'".$action."', post_id:'".$post_id."' ". $loginerror ."}, function(response) {
190
  jQuery('.fep-container.".$form_name."').html(response);
191
  jQuery( '#fep-ajax-loading' ).remove();
wordpress-creation-kit-api/wordpress-creation-kit.php CHANGED
@@ -849,7 +849,7 @@ class Wordpress_Creation_Kit{
849
  $results = get_option( $meta );
850
 
851
  $results[$element_id] = $values;
852
-
853
  do_action( 'wck_before_update_meta', $meta, $id, $values, $element_id );
854
 
855
  if( $this->args['context'] == 'post_meta' )
849
  $results = get_option( $meta );
850
 
851
  $results[$element_id] = $values;
852
+
853
  do_action( 'wck_before_update_meta', $meta, $id, $values, $element_id );
854
 
855
  if( $this->args['context'] == 'post_meta' )