Make WordPress Core

Changeset 35308


Ignore:
Timestamp:
10/20/2015 10:44:44 PM (11 years ago)
Author:
westonruter
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-setting.php

    r35305 r35308  
    11501150                        if ( ! is_int( $this->value[ $key ] ) ) {
    11511151                                $this->value[ $key ] = intval( $this->value[ $key ] );
     1152                        }
     1153                }
     1154                foreach ( array( 'classes', 'xfn' ) as $key ) {
     1155                        if ( is_array( $this->value[ $key ] ) ) {
     1156                                $this->value[ $key ] = implode( ' ', $this->value[ $key ] );
    11521157                        }
    11531158                }
Note: See TracChangeset for help on using the changeset viewer.