diff --git a/admin/mf_ajax_call.php b/admin/mf_ajax_call.php index a507bd7..508efe7 100644 --- a/admin/mf_ajax_call.php +++ b/admin/mf_ajax_call.php @@ -28,8 +28,8 @@ public function resolve($data){ public function mf_sort_field($data){ if ( !empty( $data['order'] ) && !empty( $data['group_id'] ) ) { $order = $data['order']; - $order = split(',',$order); - array_walk( $order, create_function( '&$v,$k', '$v = str_replace("order_","",$v);' )); + $order = explode(',',$order); + array_walk( $order, function( &$v,$k ) { $v = str_replace("order_","",$v); }); if( $thing = mf_custom_fields::save_order_field( $data['group_id'], $order ) ) { $resp = array('success' => true); diff --git a/admin/mf_custom_fields.php b/admin/mf_custom_fields.php index 8de65ec..15e2ad8 100644 --- a/admin/mf_custom_fields.php +++ b/admin/mf_custom_fields.php @@ -36,7 +36,7 @@ public function get_properties() { } - public function get_options($options = NULL,$name){ + public function get_options($name, $options = NULL){ global $mf_domain; print '
'; @@ -454,7 +454,7 @@ function form_custom_field( $data ) {
- + @@ -494,7 +494,7 @@ function form_custom_field( $data ) { if( $data['core']['id']['value'] ){ $name = sprintf('%s_field',$data['core']['type']['value']); $mf_field = new $name(); - $mf_field->get_options($data['option'],$name); + $mf_field->get_options($name, $data['option']); } ?>
diff --git a/admin/mf_posttype.php b/admin/mf_posttype.php index f63bc84..cbb5df6 100644 --- a/admin/mf_posttype.php +++ b/admin/mf_posttype.php @@ -604,7 +604,7 @@ public function set_categories(){ 'order' => 'ASC' ); $termsOfCategory = get_terms($name,$term_args); - $this->PrintNestedCats( $termsOfCategory, 0, 0, $customCategoryIds ); + $this->PrintNestedCats( $termsOfCategory, $customCategoryIds, 0, 0 ); echo ""; } @@ -623,7 +623,7 @@ public function set_categories(){ } - private function PrintNestedCats( $cats, $parent = 0, $depth = 0, $customCategoryIds ) { + private function PrintNestedCats( $cats, $customCategoryIds, $parent = 0, $depth = 0 ) { foreach ($cats as $cat) : if( $cat->parent == $parent ) { $checked = ""; @@ -635,7 +635,7 @@ private function PrintNestedCats( $cats, $parent = 0, $depth = 0, $customCategor echo str_repeat(' ', $depth * 4); ?> term_id?>" /> name ?>
PrintNestedCats( $cats, $cat->term_id, $depth+1, $customCategoryIds ); + $this->PrintNestedCats( $cats, $customCategoryIds, $cat->term_id, $depth+1 ); } endforeach; } @@ -663,7 +663,7 @@ public function save_post_type () { //reload form and show warning } } - $name = trim($mf['option']['capability_type']); + $name = trim($mf['option']['capability_type'] ?? ''); if( !in_array($name,array('post','page')) && !empty($name) ){ //register capabilities for admin $this->_add_cap($name); diff --git a/admin/mf_tiny_mce.php b/admin/mf_tiny_mce.php index 5f5445d..4f74ca4 100644 --- a/admin/mf_tiny_mce.php +++ b/admin/mf_tiny_mce.php @@ -271,7 +271,7 @@ function mf_tiny_mce( $teeny = false, $settings = false ) { $val = $v ? 'true' : 'false'; $mce_options .= $k . ':' . $val . ', '; continue; - } elseif ( !empty($v) && is_string($v) && ( ('{' == $v{0} && '}' == $v{strlen($v) - 1}) || ('[' == $v{0} && ']' == $v{strlen($v) - 1}) || preg_match('/^\(?function ?\(/', $v) ) ) { + } elseif ( !empty($v) && is_string($v) && ( ('{' == $v[0] && '}' == $v[strlen($v) - 1]) || ('[' == $v[0] && ']' == $v[strlen($v) - 1]) || preg_match('/^\(?function ?\(/', $v) ) ) { $mce_options .= $k . ':' . $v . ', '; continue; } diff --git a/main.php b/main.php index bd77449..0ed084a 100644 --- a/main.php +++ b/main.php @@ -3,7 +3,7 @@ * Plugin Name: Magic Fields * Plugin URI: http://magicfields.org * Description: Create custom fields for your post types - * Version: 2.3.3.2 + * Version: 2.3.7 * Author: Hunk * Author URI: http://magicfields.org * License: GPL2 diff --git a/mf_front_end.php b/mf_front_end.php index 05969ac..e1a1f96 100644 --- a/mf_front_end.php +++ b/mf_front_end.php @@ -14,7 +14,7 @@ function get ($field_name, $group_index=1, $field_index=1 ,$post_id=NULL) { if(!$post_id){ $post_id = $post->ID; } - $field = get_data($field_name,$group_index,$field_index,$post_id); + $field = get_data($field_name,$post_id,$group_index,$field_index); if(!$field) return FALSE; $type = $field['type']; @@ -227,7 +227,7 @@ function get_label($field_name,$post_id=NULL){ if(!$post_id){ $post_id = $post->ID; } - $field = get_data($field_name,1,1,$post_id); + $field = get_data($field_name,$post_id,1,1); if(!$field) return FALSE; return $field['label']; @@ -549,7 +549,7 @@ function _processed_value($value, $type, $options = array(), $image_array = 0 ){ } -function get_data( $field_name, $group_index=1, $field_index=1, $post_id ){ +function get_data( $field_name, $post_id, $group_index=1, $field_index=1 ){ global $wpdb; $field_name = str_replace(" ","_",$field_name); diff --git a/readme.markdown b/readme.markdown index 3abf607..9f64977 100644 --- a/readme.markdown +++ b/readme.markdown @@ -3,7 +3,8 @@ * Authors: [Edgar Garcia](http://hunk.com.mx "Hunk") * Tested up to: Wordpress 4.2.2 * Requires at least: 3.1 -* Stable tag: 2.3.3.2 +* Requires PHP: 8.2 +* Stable tag: 2.3.7 * Description: Magic Fields 2 is a feature rich Wordpress CMS plugin * License: GPLv2 @@ -42,6 +43,28 @@ Follow these steps to install MF2: ## Changelog ## +###2.3.7### +* PHP 8.2 compatibility improvements +* Updated minimum PHP requirement to 8.2 +* Enhanced compatibility with PHP 8.2 dynamic properties and type system +* Fixed potential issues with PHP 8.2 deprecation warnings + +###2.3.6### +* PHP 8.1 compatibility improvements +* Updated minimum PHP requirement to 8.1 +* Fixed null value handling for string functions (trim, htmlentities) +* Enhanced compatibility with PHP 8.1 deprecation warnings + +###2.3.5### +* PHP 8.0 compatibility improvements +* Updated minimum PHP requirement to 8.0 +* Enhanced error handling for PHP 8.0+ compatibility + +###2.3.4### +* PHP 7.4 and PHP 8.x compatibility fix +* Replace deprecated create_function with anonymous function +* Replace deprecated split function with explode + ###2.3.3.2### * fix problem with _processed_value and images diff --git a/readme.txt b/readme.txt index d65b14d..c6ca4b3 100644 --- a/readme.txt +++ b/readme.txt @@ -3,8 +3,9 @@ Contributors: hunk Tags: cms, post types, fields, taxonomies, custom fields, admin, advanced, edit, magic fields, more fields, Post, repeater, simple fields, text, textarea, type, advanced custom fields, cck, Tested up to: Wordpress 4.2.2 Requires at least: 3.1 +Requires PHP: 8.2 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=edgar%40programador%2ecom&lc=GB&item_name=Donation%20Magic%20Fields¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest -Stable tag: 2.3.3.2 +Stable tag: 2.3.7 Description: Magic Fields 2 is a feature rich Wordpress CMS plugin == Description == @@ -28,6 +29,28 @@ Follow this steps to install MF2 == Changelog == += 2.3.7 = +* PHP 8.2 compatibility improvements +* Updated minimum PHP requirement to 8.2 +* Enhanced compatibility with PHP 8.2 dynamic properties and type system +* Fixed potential issues with PHP 8.2 deprecation warnings + += 2.3.6 = +* PHP 8.1 compatibility improvements +* Updated minimum PHP requirement to 8.1 +* Fixed null value handling for string functions (trim, htmlentities) +* Enhanced compatibility with PHP 8.1 deprecation warnings + += 2.3.5 = +* PHP 8.0 compatibility improvements +* Updated minimum PHP requirement to 8.0 +* Enhanced error handling for PHP 8.0+ compatibility + += 2.3.4 = +* PHP 7.4 and PHP 8.x compatibility fix +* Replace deprecated create_function with anonymous function +* Replace deprecated split function with explode + = 2.3.3.1 = * fix problem with _processed_value and images