Make WordPress Core


Ignore:
Timestamp:
05/26/2012 04:08:44 AM (13 years ago)
Author:
koopersmith
Message:

Theme Customizer: Add a signature to preview requests to be super-double-ultra-sure that the customizer generated the preview. Redirects can be sneaky. fixes #20507, see #19910.

File:
1 edited

Legend:

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

    r20924 r20925  
    265265        add_action( 'wp_head', array( $this, 'customize_preview_base' ) );
    266266        add_action( 'wp_footer', array( $this, 'customize_preview_settings' ), 20 );
     267        add_action( 'shutdown', array( $this, 'customize_preview_signature' ), 1000 );
    267268
    268269        foreach ( $this->settings as $setting ) {
     
    301302        </script>
    302303        <?php
     304    }
     305
     306    /**
     307     * Prints a signature so we can ensure the customizer was properly executed.
     308     *
     309     * @since 3.4.0
     310     */
     311    public function customize_preview_signature() {
     312        echo 'WP_CUSTOMIZER_SIGNATURE';
    303313    }
    304314
Note: See TracChangeset for help on using the changeset viewer.