WordPress.org

Make WordPress Core

Changeset 20926


Ignore:
Timestamp:
05/26/2012 04:34:45 AM (6 years ago)
Author:
nacin
Message:

Theme Customizer: Introduce a remove_preview_signature() method that we can employ to ensure we do not think a wp_die() is a customizer-generated preview. see #20507.

File:
1 edited

Legend:

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

    r20925 r20926  
    266266        add_action( 'wp_footer', array( $this, 'customize_preview_settings' ), 20 );
    267267        add_action( 'shutdown', array( $this, 'customize_preview_signature' ), 1000 );
     268        add_filter( 'wp_die_handler', array( $this, 'remove_preview_signature' ) );
    268269
    269270        foreach ( $this->settings as $setting ) {
     
    311312    public function customize_preview_signature() {
    312313        echo 'WP_CUSTOMIZER_SIGNATURE';
     314    }
     315
     316    /**
     317     * Removes the signature in case we experience a case where the customizer was not properly executed.
     318     *
     319     * @since 3.4.0
     320     */
     321    public function remove_preview_signature( $return = null ) {
     322        remove_action( 'shutdown', array( $this, 'customize_preview_signature' ), 1000 );
     323
     324        return $return;
    313325    }
    314326
Note: See TracChangeset for help on using the changeset viewer.