Make WordPress Core


Ignore:
Timestamp:
03/10/2015 10:38:30 PM (12 years ago)
Author:
ocean90
Message:

Customizer: Fix previewing and applying widgets when previewing another theme.

  • Unset wp_get_sidebars_widgets()' non-admin cache var $_wp_sidebars_widgets in Customize theme preview.
  • Add WP_Customize_Setting::$dirty so that settings can be initially-dirty when the Customizer loads.
  • Mark old_sidebars_widgets_data setting initially-dirty.
  • Mark all sidebars_widgets settings as initially-dirty during theme switch.

props westonruter.
see #31484.

File:
1 edited

Legend:

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

    r31543 r31705  
    6060        public $sanitize_callback    = '';
    6161        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;
    6276
    6377        protected $id_data = array();
Note: See TracChangeset for help on using the changeset viewer.