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
This commit is contained in:
ryan 2012-06-07 01:29:57 +00:00
parent d15f104e4b
commit 07140847b2
3 changed files with 9 additions and 8 deletions

View File

@ -586,9 +586,9 @@
}, { }, {
query: function() { query: function() {
return { return {
customize: 'on', wp_customize: 'on',
theme: api.settings.theme.stylesheet, theme: api.settings.theme.stylesheet,
customized: JSON.stringify( api.get() ) customized: JSON.stringify( api.get() )
}; };
}, },

View File

@ -54,7 +54,7 @@ if ( typeof wp === 'undefined' )
hashchange: function( e ) { hashchange: function( e ) {
var hash = window.location.toString().split('#')[1]; 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 ); Loader.open( Loader.settings.url + '?' + hash );
if ( ! hash && ! $.support.history ) if ( ! hash && ! $.support.history )
@ -104,7 +104,7 @@ if ( typeof wp === 'undefined' )
if ( $.support.history && window.location.href !== src ) if ( $.support.history && window.location.href !== src )
history.pushState( { customize: src }, '', src ); history.pushState( { customize: src }, '', src );
else if ( ! $.support.history && $.support.hashchange && hash ) else if ( ! $.support.history && $.support.hashchange && hash )
window.location.hash = 'customize=on&' + hash; window.location.hash = 'wp_customize=on&' + hash;
this.trigger( 'open' ); this.trigger( 'open' );
}, },

View File

@ -1578,13 +1578,14 @@ function check_theme_switched() {
/** /**
* Includes and instantiates the WP_Customize_Manager class. * 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 * @since 3.4.0
*/ */
function _wp_customize_include() { function _wp_customize_include() {
// Load on themes.php or ?customize=on if ( ! ( ( isset( $_REQUEST['wp_customize'] ) && 'on' == $_REQUEST['wp_customize'] )
if ( ! ( ( isset( $_REQUEST['customize'] ) && 'on' == $_REQUEST['customize'] ) || 'customize.php' == basename( $_SERVER['PHP_SELF'] ) ) ) || ( is_admin() && 'customize.php' == basename( $_SERVER['PHP_SELF'] ) )
) )
return; return;
require( ABSPATH . WPINC . '/class-wp-customize-manager.php' ); require( ABSPATH . WPINC . '/class-wp-customize-manager.php' );