Message info
 
To:wp-svn@lists.automattic.com From:m@wordpress.org Subject:[wp-svn] [21016] trunk: Namespace the customize request arg to prevent collision with plugins and themes . Date:Thu, 7 Jun 2012 01:29:57 +0000 (UTC)
 

Revision
21016
Author
ryan
Date
2012-06-07 01:29:57 +0000 (Thu, 07 Jun 2012)

Log Message

Namespace the customize request arg to prevent collision with plugins and themes. Props nacin. fixes #20862

Modified Paths

Diff

Modified: trunk/wp-admin/js/customize-controls.dev.js (21015 => 21016)


--- trunk/wp-admin/js/customize-controls.dev.js	2012-06-06 21:51:13 UTC (rev 21015)
+++ trunk/wp-admin/js/customize-controls.dev.js	2012-06-07 01:29:57 UTC (rev 21016)
@@ -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() )
 				};
 			},
 

Modified: trunk/wp-includes/js/customize-loader.dev.js (21015 => 21016)


--- trunk/wp-includes/js/customize-loader.dev.js	2012-06-06 21:51:13 UTC (rev 21015)
+++ trunk/wp-includes/js/customize-loader.dev.js	2012-06-07 01:29:57 UTC (rev 21016)
@@ -54,7 +54,7 @@
 		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 ( $.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' );
 		},

Modified: trunk/wp-includes/theme.php (21015 => 21016)


--- trunk/wp-includes/theme.php	2012-06-06 21:51:13 UTC (rev 21015)
+++ trunk/wp-includes/theme.php	2012-06-07 01:29:57 UTC (rev 21016)
@@ -1578,13 +1578,14 @@
 /**
  * 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' );