mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@20925 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -264,6 +264,7 @@ final class WP_Customize_Manager {
|
||||
wp_enqueue_script( 'customize-preview' );
|
||||
add_action( 'wp_head', array( $this, 'customize_preview_base' ) );
|
||||
add_action( 'wp_footer', array( $this, 'customize_preview_settings' ), 20 );
|
||||
add_action( 'shutdown', array( $this, 'customize_preview_signature' ), 1000 );
|
||||
|
||||
foreach ( $this->settings as $setting ) {
|
||||
$setting->preview();
|
||||
@@ -302,6 +303,15 @@ final class WP_Customize_Manager {
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints a signature so we can ensure the customizer was properly executed.
|
||||
*
|
||||
* @since 3.4.0
|
||||
*/
|
||||
public function customize_preview_signature() {
|
||||
echo 'WP_CUSTOMIZER_SIGNATURE';
|
||||
}
|
||||
|
||||
/**
|
||||
* Is it a theme preview?
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user