Changeset 41205 for trunk/src/wp-includes/class-wp-customize-manager.php
- Timestamp:
- 08/02/2017 05:34:32 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-customize-manager.php
r41162 r41205 175 175 176 176 /** 177 * Whether settings should be previewed. 178 * 179 * @since 4.9.0 180 * @var bool 181 */ 182 protected $settings_previewed; 183 184 /** 177 185 * Unsanitized values for Customize Settings parsed from $_POST['customized']. 178 186 * … … 214 222 * Args. 215 223 * 216 * @type string $changeset_uuid Changeset UUID, the post_name for the customize_changeset post containing the customized state. Defaults to new UUID. 217 * @type string $theme Theme to be previewed (for theme switch). Defaults to customize_theme or theme query params. 218 * @type string $messenger_channel Messenger channel. Defaults to customize_messenger_channel query param. 224 * @type string $changeset_uuid Changeset UUID, the post_name for the customize_changeset post containing the customized state. Defaults to new UUID. 225 * @type string $theme Theme to be previewed (for theme switch). Defaults to customize_theme or theme query params. 226 * @type string $messenger_channel Messenger channel. Defaults to customize_messenger_channel query param. 227 * @type bool $settings_previewed If settings should be previewed. Defaults to true. 219 228 * } 220 229 */ … … 222 231 223 232 $args = array_merge( 224 array_fill_keys( array( 'changeset_uuid', 'theme', 'messenger_channel' ), null ),233 array_fill_keys( array( 'changeset_uuid', 'theme', 'messenger_channel', 'settings_previewed' ), null ), 225 234 $args 226 235 ); … … 243 252 } 244 253 254 if ( ! isset( $args['settings_previewed'] ) ) { 255 $args['settings_previewed'] = true; 256 } 257 245 258 $this->original_stylesheet = get_stylesheet(); 246 259 $this->theme = wp_get_theme( $args['theme'] ); 247 260 $this->messenger_channel = $args['messenger_channel']; 261 $this->settings_previewed = ! empty( $args['settings_previewed'] ); 248 262 $this->_changeset_uuid = $args['changeset_uuid']; 249 263 … … 623 637 624 638 /** 639 * Gets whether settings are or will be previewed. 640 * 641 * @since 4.9.0 642 * @see WP_Customize_Setting::preview() 643 * 644 * @return bool 645 */ 646 public function settings_previewed() { 647 return $this->settings_previewed; 648 } 649 650 /** 625 651 * Get the changeset UUID. 626 652 * … … 729 755 do_action( 'customize_register', $this ); 730 756 731 /* 732 * Note that settings must be previewed here even outside the customizer preview 733 * and also in the customizer pane itself. This is to enable loading an existing 734 * changeset into the customizer. Previewing the settings only has to be prevented 735 * in the case of a customize_save action because then update_option() 736 * may short-circuit because it will detect that there are no changes to 737 * make. 738 */ 739 if ( ! $this->doing_ajax( 'customize_save' ) ) { 757 if ( $this->settings_previewed() ) { 740 758 foreach ( $this->settings as $setting ) { 741 759 $setting->preview();
Note: See TracChangeset
for help on using the changeset viewer.