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
This commit is contained in:
Weston Ruter 2015-10-20 22:45:29 +00:00
parent bee05e0cdc
commit d7e13544ea
2 changed files with 6 additions and 1 deletions

View File

@ -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'] = (

View File

@ -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.