From 07140847b21e454d1263274a4aa9425e8d2b2014 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 7 Jun 2012 01:29:57 +0000 Subject: [PATCH] Namespace the customize request arg to prevent collision with plugins and themes. Props nacin. fixes #20862 git-svn-id: http://core.svn.wordpress.org/trunk@21016 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/js/customize-controls.dev.js | 6 +++--- wp-includes/js/customize-loader.dev.js | 4 ++-- wp-includes/theme.php | 7 ++++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/wp-admin/js/customize-controls.dev.js b/wp-admin/js/customize-controls.dev.js index 6f7bed51c6..fa47e459c2 100644 --- a/wp-admin/js/customize-controls.dev.js +++ b/wp-admin/js/customize-controls.dev.js @@ -586,9 +586,9 @@ }, { query: function() { return { - customize: 'on', - theme: api.settings.theme.stylesheet, - customized: JSON.stringify( api.get() ) + wp_customize: 'on', + theme: api.settings.theme.stylesheet, + customized: JSON.stringify( api.get() ) }; }, diff --git a/wp-includes/js/customize-loader.dev.js b/wp-includes/js/customize-loader.dev.js index 5c4b2d7b02..403708fc68 100644 --- a/wp-includes/js/customize-loader.dev.js +++ b/wp-includes/js/customize-loader.dev.js @@ -54,7 +54,7 @@ if ( typeof wp === 'undefined' ) hashchange: function( e ) { var hash = window.location.toString().split('#')[1]; - if ( hash && 0 === hash.indexOf( 'customize=on' ) ) + if ( hash && 0 === hash.indexOf( 'wp_customize=on' ) ) Loader.open( Loader.settings.url + '?' + hash ); if ( ! hash && ! $.support.history ) @@ -104,7 +104,7 @@ if ( typeof wp === 'undefined' ) if ( $.support.history && window.location.href !== src ) history.pushState( { customize: src }, '', src ); else if ( ! $.support.history && $.support.hashchange && hash ) - window.location.hash = 'customize=on&' + hash; + window.location.hash = 'wp_customize=on&' + hash; this.trigger( 'open' ); }, diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 58ffe50843..6c1bfc2be7 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1578,13 +1578,14 @@ function check_theme_switched() { /** * Includes and instantiates the WP_Customize_Manager class. * - * Fires when ?customize=on. + * Fires when ?wp_customize=on or on wp-admin/customize.php. * * @since 3.4.0 */ function _wp_customize_include() { - // Load on themes.php or ?customize=on - if ( ! ( ( isset( $_REQUEST['customize'] ) && 'on' == $_REQUEST['customize'] ) || 'customize.php' == basename( $_SERVER['PHP_SELF'] ) ) ) + if ( ! ( ( isset( $_REQUEST['wp_customize'] ) && 'on' == $_REQUEST['wp_customize'] ) + || ( is_admin() && 'customize.php' == basename( $_SERVER['PHP_SELF'] ) ) + ) ) return; require( ABSPATH . WPINC . '/class-wp-customize-manager.php' );