- Timestamp:
- 02/01/2017 01:39:39 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-customize-setting.php
r39600 r40036 588 588 if ( 'option' === $this->type ) { 589 589 return get_option( $id_base, $default ); 590 } else if ( 'theme_mod') {590 } elseif ( 'theme_mod' === $this->type ) { 591 591 return get_theme_mod( $id_base, $default ); 592 592 } else { … … 617 617 } 618 618 return update_option( $id_base, $value, $autoload ); 619 } else if ( 'theme_mod') {619 } elseif ( 'theme_mod' === $this->type ) { 620 620 set_theme_mod( $id_base, $value ); 621 621 return true; -
trunk/tests/phpunit/tests/customize/setting.php
r39919 r40036 403 403 'sanitize_callback' => array( $this->manager->nav_menus, 'intval_base10' ), 404 404 ) ); 405 406 /* 407 * In #36952 the conditions were such that get_theme_mod() be erroneously used 408 * to source the root value for a custom multidimensional type. 409 * Add a theme mod with the same name as the custom setting to test fix. 410 */ 411 set_theme_mod( $setting_id, 999 ); 405 412 $this->assertSame( 123, $setting->value() ); 413 406 414 $this->manager->set_post_value( $setting_id, '456' ); 407 415 $setting->preview(); … … 409 417 410 418 unset( $this->custom_type_data_previewed, $this->custom_type_data_saved ); 419 remove_theme_mod( $setting_id ); 411 420 } 412 421
Note: See TracChangeset
for help on using the changeset viewer.