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

Version Description

  • Compatibility fixes for PHP 8.0
Download this release

Release Info

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

Code changes from version 2.3.0 to 2.3.1

readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: cozmoslabs, reflectionmedia, madalin.ungureanu, sareiodata, adispi
3
  Donate link: http://www.cozmoslabs.com/wordpress-creation-kit/
4
  Tags: custom fields, custom field, wordpress custom fields, custom post type, custom post types, post types, repeater fields, meta box, metabox, custom taxonomy, custom fields creator, post meta
5
  Requires at least: 3.1
6
- Tested up to: 5.9.1
7
- Stable tag: 2.3.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -135,6 +135,9 @@ Creating a taxonomy generally automatically creates a special query variable usi
135
  10. Taxonomy listing
136
 
137
  == Changelog ==
 
 
 
138
  = 2.3.0 =
139
  * Fixed an error in front-end console coming from the color picker script
140
  * Fixed a small issue when creating custom field metaboxes
3
  Donate link: http://www.cozmoslabs.com/wordpress-creation-kit/
4
  Tags: custom fields, custom field, wordpress custom fields, custom post type, custom post types, post types, repeater fields, meta box, metabox, custom taxonomy, custom fields creator, post meta
5
  Requires at least: 3.1
6
+ Tested up to: 5.9.3
7
+ Stable tag: 2.3.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
135
  10. Taxonomy listing
136
 
137
  == Changelog ==
138
+ = 2.3.1 =
139
+ * Compatibility fixes for PHP 8.0
140
+
141
  = 2.3.0 =
142
  * Fixed an error in front-end console coming from the color picker script
143
  * Fixed a small issue when creating custom field metaboxes
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: 2.3.0
7
  Author URI: http://www.cozmoslabs.com
8
  Text Domain: wck
9
  Domain Path: /languages
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: 2.3.1
7
  Author URI: http://www.cozmoslabs.com
8
  Text Domain: wck
9
  Domain Path: /languages
wordpress-creation-kit-api/assets/map/map.php CHANGED
@@ -37,7 +37,7 @@ function wck_map_field_add_meta( $meta, $id, $values, $element_id = '' ) {
37
  continue;
38
 
39
  // calculate element id
40
- $element_id = ( $element_id != '' ? ( (int)$element_id + 1 ) : ( $args[0]['repeater'] == 'false' ? 1 : count( $meta_values ) + 1 ) );
41
 
42
  $fields = get_post_meta( $field_set->ID, 'wck_' . ( !empty( $id ) ? 'cfc' : 'opc' ) . '_fields', true );
43
 
@@ -51,8 +51,8 @@ function wck_map_field_add_meta( $meta, $id, $values, $element_id = '' ) {
51
 
52
  if( !empty( $values[ Wordpress_Creation_Kit::wck_generate_slug( $field['field-title'], $field ) ] ) ) {
53
 
54
- wck_map_field_delete_metadata( $id, $meta, $field, $element_id );
55
- wck_map_field_update_metadata( $id, $meta, $field, $element_id, $values[ Wordpress_Creation_Kit::wck_generate_slug( $field['field-title'], $field ) ] );
56
 
57
  }
58
 
@@ -69,7 +69,7 @@ add_action( 'wck_before_update_meta', 'wck_map_field_add_meta', 10, 4 );
69
  * Add all markers for a map field as individual post_meta or options
70
  *
71
  */
72
- function wck_map_field_update_metadata( $id = '', $meta, $field, $element_id, $map_markers = array() ) {
73
 
74
  if( !empty( $map_markers ) ) {
75
  foreach( $map_markers as $key => $map_marker ) {
@@ -90,7 +90,7 @@ function wck_map_field_update_metadata( $id = '', $meta, $field, $element_id, $m
90
  * Removes all markers for a map field from the post_meta or options
91
  *
92
  */
93
- function wck_map_field_delete_metadata( $id = '', $meta, $field, $element_id ) {
94
 
95
  global $wpdb;
96
 
37
  continue;
38
 
39
  // calculate element id
40
+ $element_id = ( $element_id != '' ? ( (int)$element_id + 1 ) : ( $args[0]['repeater'] == 'false' ? 1 : count( (array)$meta_values ) + 1 ) );
41
 
42
  $fields = get_post_meta( $field_set->ID, 'wck_' . ( !empty( $id ) ? 'cfc' : 'opc' ) . '_fields', true );
43
 
51
 
52
  if( !empty( $values[ Wordpress_Creation_Kit::wck_generate_slug( $field['field-title'], $field ) ] ) ) {
53
 
54
+ wck_map_field_delete_metadata($meta, $field, $element_id, $id);
55
+ wck_map_field_update_metadata($meta, $field, $element_id, $values[Wordpress_Creation_Kit::wck_generate_slug($field['field-title'], $field)], $id);
56
 
57
  }
58
 
69
  * Add all markers for a map field as individual post_meta or options
70
  *
71
  */
72
+ function wck_map_field_update_metadata($meta, $field, $element_id, $map_markers = array(), $id = '') {
73
 
74
  if( !empty( $map_markers ) ) {
75
  foreach( $map_markers as $key => $map_marker ) {
90
  * Removes all markers for a map field from the post_meta or options
91
  *
92
  */
93
+ function wck_map_field_delete_metadata($meta, $field, $element_id, $id = '') {
94
 
95
  global $wpdb;
96