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

Version Description

  • Minor security improvements
  • Added filter for the 'rewrite' argument in the Custom Taxonomy Creator: 'wck_ctc_register_taxonomy_rewrite_arg'
  • Added hooks in WCK_Page_Creator api to allow extra content before and after metaboxes: 'wck_page_creator_before_meta_boxes' and 'wck_page_creator_after_meta_boxes'
Download this release

Release Info

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

Code changes from version 1.2.2 to 1.2.3

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.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.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
6
 
7
  Requires at least: 3.1
8
  Tested up to: 4.4.2
9
+ Stable tag: 1.2.3
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.3 =
145
+ * Minor security improvements
146
+ * Added filter for the 'rewrite' argument in the Custom Taxonomy Creator: 'wck_ctc_register_taxonomy_rewrite_arg'
147
+ * Added hooks in WCK_Page_Creator api to allow extra content before and after metaboxes: 'wck_page_creator_before_meta_boxes' and 'wck_page_creator_after_meta_boxes'
148
+
149
  = 1.2.2 =
150
  * Added additional labels to Post Type Creator and Taxonomy Creator
151
  * We now check the post type name to not have spaces, capital letters or hyphens
wck-ctc.php CHANGED
@@ -149,6 +149,7 @@ function wck_ctc_create_taxonomy(){
149
  'hierarchical' => $ct['hierarchical'] == 'false' ? false : true,
150
  'show_tagcloud' => $ct['show-tagcloud'] == 'false' ? false : true,
151
  'show_in_rest' => !empty($ct['show-in-rest']) ? $ct['show-in-rest'] : false,
 
152
  );
153
 
154
  if( !empty( $ct['show-admin-column'] ) ){
149
  'hierarchical' => $ct['hierarchical'] == 'false' ? false : true,
150
  'show_tagcloud' => $ct['show-tagcloud'] == 'false' ? false : true,
151
  'show_in_rest' => !empty($ct['show-in-rest']) ? $ct['show-in-rest'] : false,
152
+ 'rewrite' => apply_filters( 'wck_ctc_register_taxonomy_rewrite_arg', true, $ct ),
153
  );
154
 
155
  if( !empty( $ct['show-admin-column'] ) ){
wck-sas.php CHANGED
@@ -286,10 +286,10 @@ if (file_exists ($wck_premium_update . 'update-checker.php')) {
286
  if ($wck_serial_status == 'notFound' || $wck_serial_status == 'noserial' || $wck_serial_status == '') {
287
  new wck_add_serial_notices('wck', sprintf(__('<p>Your <strong>WordPress Creation Kit</strong> serial number is invalid or missing. <br/>Please %1$sregister your copy%2$s of WCK to receive access to automatic updates and support. Need a license key? %3$sPurchase one now%4$s</p>', 'wck'), "<a href='admin.php?page=sas-page'>", "</a>", "<a href='http://www.cozmoslabs.com/wck-custom-fields-custom-post-types-plugin/?utm_source=WCK&utm_medium=dashboard&utm_campaign=WCK-SN-Purchase' target='_blank' class='button-primary'>", "</a>"), 'wck_serial_status');
288
  } elseif ($wck_serial_status == 'expired') {
289
- new wck_add_serial_notices('wck_expired', sprintf(__('<p style="position:relative;">Your <strong>WordPress Creation Kit</strong> licence has expired. <br/>Please %1$sRenew Your Licence%2$s to continue receiving access to product downloads, automatic updates and support. %3$sRenew now and get 50&#37; off %4$s %5$sDismiss%6$s</p>', 'wck'), "<a href='http://www.cozmoslabs.com/downloads/wordpress-creation-kit-".$wck_version."-yearly-renewal/?utm_source=WCK&utm_medium=dashboard&utm_campaign=WCK-Renewal' target='_blank'>", "</a>", "<a href='http://www.cozmoslabs.com/downloads/wordpress-creation-kit-".$wck_version."-yearly-renewal/?utm_source=WCK&utm_medium=dashboard&utm_campaign=WCK-Renewal' target='_blank' class='button-primary'>", "</a>", "<a href='" . add_query_arg('wck_expired_dismiss_notification', '0') . "' class='wck-dismiss-notification' style='position:absolute; right:0px; top:50%; margin-top:-7px;'>", "</a>"), 'wck_serial_status');
290
  } elseif (strpos($wck_serial_status, 'aboutToExpire') === 0) {
291
  $serial_status_parts = explode( '#', $wck_serial_status );
292
  $date = $serial_status_parts[1];
293
- new wck_add_serial_notices('wck_about_to_expire', sprintf(__('<p style="position:relative;">Your <strong>WordPress Creation Kit</strong> serial number is about to expire on %5$s. <br/>Please %1$sRenew Your Licence%2$s to continue receiving access to product downloads, automatic updates and support. %3$sRenew now and get 50&#37; off %4$s %6$sDismiss%7$s</p>', 'wck'), "<a href='http://www.cozmoslabs.com/downloads/wordpress-creation-kit-".$wck_version."-yearly-renewal/?utm_source=WCK&utm_medium=dashboard&utm_campaign=WCK-Renewal'>", "</a>", "<a href='http://www.cozmoslabs.com/downloads/wordpress-creation-kit-".$wck_version."-yearly-renewal/?utm_source=WCK&utm_medium=dashboard&utm_campaign=WCK-Renewal' target='_blank' class='button-primary'>", "</a>", $date, "<a href='" . add_query_arg('wck_about_to_expire_dismiss_notification', '0') . "' class='wck-dismiss-notification' style='position:absolute; right:0px; top:50%; margin-top:-7px;'>", "</a>"), 'wck_serial_status');
294
  }
295
  }
286
  if ($wck_serial_status == 'notFound' || $wck_serial_status == 'noserial' || $wck_serial_status == '') {
287
  new wck_add_serial_notices('wck', sprintf(__('<p>Your <strong>WordPress Creation Kit</strong> serial number is invalid or missing. <br/>Please %1$sregister your copy%2$s of WCK to receive access to automatic updates and support. Need a license key? %3$sPurchase one now%4$s</p>', 'wck'), "<a href='admin.php?page=sas-page'>", "</a>", "<a href='http://www.cozmoslabs.com/wck-custom-fields-custom-post-types-plugin/?utm_source=WCK&utm_medium=dashboard&utm_campaign=WCK-SN-Purchase' target='_blank' class='button-primary'>", "</a>"), 'wck_serial_status');
288
  } elseif ($wck_serial_status == 'expired') {
289
+ new wck_add_serial_notices('wck_expired', sprintf(__('<p style="position:relative;">Your <strong>WordPress Creation Kit</strong> licence has expired. <br/>Please %1$sRenew Your Licence%2$s to continue receiving access to product downloads, automatic updates and support. %3$sRenew now and get 50&#37; off %4$s %5$sDismiss%6$s</p>', 'wck'), "<a href='http://www.cozmoslabs.com/downloads/wordpress-creation-kit-".$wck_version."-yearly-renewal/?utm_source=WCK&utm_medium=dashboard&utm_campaign=WCK-Renewal' target='_blank'>", "</a>", "<a href='". esc_url( "http://www.cozmoslabs.com/downloads/wordpress-creation-kit-".$wck_version."-yearly-renewal/?utm_source=WCK&utm_medium=dashboard&utm_campaign=WCK-Renewal") ."' target='_blank' class='button-primary'>", "</a>", "<a href='" . esc_url( add_query_arg('wck_expired_dismiss_notification', '0') ) . "' class='wck-dismiss-notification' style='position:absolute; right:0px; top:50%; margin-top:-7px;'>", "</a>"), 'wck_serial_status');
290
  } elseif (strpos($wck_serial_status, 'aboutToExpire') === 0) {
291
  $serial_status_parts = explode( '#', $wck_serial_status );
292
  $date = $serial_status_parts[1];
293
+ new wck_add_serial_notices('wck_about_to_expire', sprintf(__('<p style="position:relative;">Your <strong>WordPress Creation Kit</strong> serial number is about to expire on %5$s. <br/>Please %1$sRenew Your Licence%2$s to continue receiving access to product downloads, automatic updates and support. %3$sRenew now and get 50&#37; off %4$s %6$sDismiss%7$s</p>', 'wck'), "<a href='http://www.cozmoslabs.com/downloads/wordpress-creation-kit-".$wck_version."-yearly-renewal/?utm_source=WCK&utm_medium=dashboard&utm_campaign=WCK-Renewal'>", "</a>", "<a href='". esc_url( "http://www.cozmoslabs.com/downloads/wordpress-creation-kit-".$wck_version."-yearly-renewal/?utm_source=WCK&utm_medium=dashboard&utm_campaign=WCK-Renewal" ) ."' target='_blank' class='button-primary'>", "</a>", $date, "<a href='" . esc_url( add_query_arg('wck_about_to_expire_dismiss_notification', '0') ) . "' class='wck-dismiss-notification' style='position:absolute; right:0px; top:50%; margin-top:-7px;'>", "</a>"), 'wck_serial_status');
294
  }
295
  }
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.2
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.3
7
  Author URI: http://www.cozmoslabs.com
8
 
9
  License: GPL2
wordpress-creation-kit-api/wck-fep/wck-fep.php CHANGED
@@ -182,11 +182,18 @@ class WCK_FrontEnd_Posting extends Wordpress_Creation_Kit{
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();
192
  jQuery(mb_sortable_elements);
@@ -311,7 +318,7 @@ class WCK_FrontEnd_Posting extends Wordpress_Creation_Kit{
311
  if ( $fep_form ){
312
  $author_id = $fep_form->post_author;
313
  $user_ID = get_current_user_id();
314
- if ( !current_user_can( 'edit_others_posts' ) ) {
315
  if ($author_id != $user_ID) {
316
  $error = '<div class="fep-error fep-access-denied">' . __( "You are not allowed to edit this post.", "wck" ) . '</div>';
317
  return $error;
@@ -752,7 +759,7 @@ class WCK_FEP_Dashboard{
752
  'post_type' => $post_type->name
753
  );
754
  $posts = get_posts( apply_filters( 'wck_fep_dashbord_get_posts_args', $args ) );
755
-
756
  if( !empty( $posts ) )
757
  $dashboard .= '<li><a href="#fep-'. $post_type->name .'">'. __( 'My ', 'wck' ) .$post_type->label.'</a></li>';
758
  }
@@ -802,14 +809,14 @@ class WCK_FEP_Dashboard{
802
  }
803
 
804
  if( !empty( $shortcode_page_id ) ){
805
- $arr_params = array ( 'action' => 'edit', 'post_id' => $post->ID );
806
  $edit_link = add_query_arg( $arr_params, get_permalink( $shortcode_page_id ) );
807
  }
808
 
809
 
810
  $dashboard .= '<li id="'. $post->ID .'"><a href="'. get_permalink( $post->ID ) .'">'. get_the_title( $post->ID ) .'</a>';
811
  if( !empty( $edit_link ) )
812
- $dashboard .= ' <a class="wck-edit-post" href="'.$edit_link.'">'. __( 'Edit', 'wck' ) .'</a> ';
813
 
814
  $delete_nonce = wp_create_nonce( 'wck-fep-delete-entry' );
815
  $dashboard .= ' <a class="wck-delete-post" href="javascript:void(0)" onclick="wckFepDeletePost(\''.$post->ID.'\', \''. $delete_nonce .'\')">'. __( 'Delete', 'wck' ) .'</a> </li>';
182
  else
183
  $post_id = '';
184
 
185
+ /* edit nonce */
186
+ if( !empty( $_GET['_wpnonce'] ) ){
187
+ $edit_nonce = $_GET['_wpnonce'];
188
+ }
189
+ else
190
+ $edit_nonce = '';
191
+
192
  /* make sure we have jquery at this point */
193
  wp_print_scripts( 'jquery' );
194
 
195
  $output .= "<script type='text/javascript'>
196
+ jQuery.post( wckAjaxurl, { action:'wck_fep_create_frontend_form_".$form_name."', action_type:'".$action."', post_id:'".$post_id."', _wpnonce:'". $edit_nonce ."' ". $loginerror ."}, function(response) {
197
  jQuery('.fep-container.".$form_name."').html(response);
198
  jQuery( '#fep-ajax-loading' ).remove();
199
  jQuery(mb_sortable_elements);
318
  if ( $fep_form ){
319
  $author_id = $fep_form->post_author;
320
  $user_ID = get_current_user_id();
321
+ if ( !current_user_can( 'edit_others_posts' ) && !wp_verify_nonce( $_REQUEST['_wpnonce'], 'wck-fep-dashboard-edit-'.$post_id.'-'.$user_ID ) ){
322
  if ($author_id != $user_ID) {
323
  $error = '<div class="fep-error fep-access-denied">' . __( "You are not allowed to edit this post.", "wck" ) . '</div>';
324
  return $error;
759
  'post_type' => $post_type->name
760
  );
761
  $posts = get_posts( apply_filters( 'wck_fep_dashbord_get_posts_args', $args ) );
762
+
763
  if( !empty( $posts ) )
764
  $dashboard .= '<li><a href="#fep-'. $post_type->name .'">'. __( 'My ', 'wck' ) .$post_type->label.'</a></li>';
765
  }
809
  }
810
 
811
  if( !empty( $shortcode_page_id ) ){
812
+ $arr_params = array ( 'action' => 'edit', 'post_id' => $post->ID, '_wpnonce' => wp_create_nonce( 'wck-fep-dashboard-edit-'.$post->ID.'-'.$user_id ) );
813
  $edit_link = add_query_arg( $arr_params, get_permalink( $shortcode_page_id ) );
814
  }
815
 
816
 
817
  $dashboard .= '<li id="'. $post->ID .'"><a href="'. get_permalink( $post->ID ) .'">'. get_the_title( $post->ID ) .'</a>';
818
  if( !empty( $edit_link ) )
819
+ $dashboard .= ' <a class="wck-edit-post" href="'.esc_url( $edit_link ).'">'. __( 'Edit', 'wck' ) .'</a> ';
820
 
821
  $delete_nonce = wp_create_nonce( 'wck-fep-delete-entry' );
822
  $dashboard .= ' <a class="wck-delete-post" href="javascript:void(0)" onclick="wckFepDeletePost(\''.$post->ID.'\', \''. $delete_nonce .'\')">'. __( 'Delete', 'wck' ) .'</a> </li>';
wordpress-creation-kit-api/wordpress-creation-kit.php CHANGED
@@ -1505,8 +1505,10 @@ class WCK_Page_Creator{
1505
  /**
1506
  * Do action 'add_meta_boxes'. This hook isn't executed by default on a admin page so we have to add it.
1507
  */
1508
- function wck_settings_page_add_meta_boxes() {
 
1509
  do_action( 'add_meta_boxes', $this->hookname, 0 );
 
1510
  }
1511
 
1512
  /**
1505
  /**
1506
  * Do action 'add_meta_boxes'. This hook isn't executed by default on a admin page so we have to add it.
1507
  */
1508
+ function wck_settings_page_add_meta_boxes() {
1509
+ do_action( 'wck_page_creator_before_meta_boxes', $this->hookname );
1510
  do_action( 'add_meta_boxes', $this->hookname, 0 );
1511
+ do_action( 'wck_page_creator_after_meta_boxes', $this->hookname );
1512
  }
1513
 
1514
  /**