From d7e13544eabebe3fba58fae40fe7f4d1091e34ee Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Tue, 20 Oct 2015 22:45:29 +0000 Subject: [PATCH] Customizer: Prevent `nav_menu_item` settings from becoming dirty when their controls are set up. Since `wp_setup_nav_menu_item()` returns the `classes` property as an array but the Customizer manages the value as a string, the setting needs to initially export the value as a string. This prevents the `classes` property type change from causing the setting to get marked as dirty even though nothing changed. This is a regression from [34788]. See #34111. Built from https://develop.svn.wordpress.org/trunk@35308 git-svn-id: http://core.svn.wordpress.org/trunk@35274 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-customize-setting.php | 5 +++++ wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-wp-customize-setting.php b/wp-includes/class-wp-customize-setting.php index c7cff51fe5..af850098ce 100644 --- a/wp-includes/class-wp-customize-setting.php +++ b/wp-includes/class-wp-customize-setting.php @@ -1151,6 +1151,11 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { $this->value[ $key ] = intval( $this->value[ $key ] ); } } + foreach ( array( 'classes', 'xfn' ) as $key ) { + if ( is_array( $this->value[ $key ] ) ) { + $this->value[ $key ] = implode( ' ', $this->value[ $key ] ); + } + } if ( ! isset( $this->value['_invalid'] ) ) { $this->value['_invalid'] = ( diff --git a/wp-includes/version.php b/wp-includes/version.php index d141779346..a16658cfa7 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-35307'; +$wp_version = '4.4-alpha-35308'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.