Changeset 31705
- Timestamp:
- 03/10/2015 10:38:30 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/customize.php
r31594 r31705 251 251 'value' => $setting->js_value(), 252 252 'transport' => $setting->transport, 253 'dirty' => $setting->dirty, 253 254 ); 254 255 } -
trunk/src/wp-admin/js/customize-controls.js
r31704 r31705 18 18 this.id = id; 19 19 this.transport = this.transport || 'refresh'; 20 this._dirty = options.dirty || false; 20 21 21 22 this.bind( this.preview ); … … 2517 2518 api.create( id, id, data.value, { 2518 2519 transport: data.transport, 2519 previewer: api.previewer 2520 previewer: api.previewer, 2521 dirty: !! data.dirty 2520 2522 } ); 2521 2523 }); -
trunk/src/wp-includes/class-wp-customize-setting.php
r31543 r31705 60 60 public $sanitize_callback = ''; 61 61 public $sanitize_js_callback = ''; 62 63 /** 64 * Whether or not the setting is initially dirty when created. 65 * 66 * This is used to ensure that a setting will be sent from the pane to the 67 * preview when loading the Customizer. Normally a setting only is synced to 68 * the preview if it has been changed. This allows the setting to be sent 69 * from the start. 70 * 71 * @since 4.2.0 72 * @access public 73 * @var bool 74 */ 75 public $dirty = false; 62 76 63 77 protected $id_data = array(); -
trunk/src/wp-includes/class-wp-customize-widgets.php
r31544 r31705 217 217 $sidebars_widgets = retrieve_widgets( 'customize' ); 218 218 add_filter( 'option_sidebars_widgets', array( $this, 'filter_option_sidebars_widgets_for_theme_switch' ), 1 ); 219 unset( $GLOBALS['_wp_sidebars_widgets'] ); // reset global cache var used by wp_get_sidebars_widgets() 219 220 } 220 221 … … 333 334 $setting_args = $this->get_setting_args( $setting_id, array( 334 335 'type' => 'global_variable', 336 'dirty' => true, 335 337 ) ); 336 338 $this->manager->add_setting( $setting_id, $setting_args ); … … 357 359 $setting_args = $this->get_setting_args( $setting_id ); 358 360 if ( ! $this->manager->get_setting( $setting_id ) ) { 361 if ( ! $this->manager->is_theme_active() ) { 362 $setting_args['dirty'] = true; 363 } 359 364 $this->manager->add_setting( $setting_id, $setting_args ); 360 365 } -
trunk/tests/phpunit/tests/customize/setting.php
r31622 r31705 45 45 $this->assertFalse( has_filter( "customize_sanitize_{$setting->id}" ) ); 46 46 $this->assertFalse( has_filter( "customize_sanitize_js_{$setting->id}" ) ); 47 $this->assertEquals( false, $setting->dirty ); 47 48 } 48 49
Note: See TracChangeset
for help on using the changeset viewer.