<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[20802] trunk: Theme Customizer: Properly change state when theme is switched.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/20802">20802</a></dd>
<dt>Author</dt> <dd>koopersmith</dd>
<dt>Date</dt> <dd>2012-05-16 05:55:54 +0000 (Wed, 16 May 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Theme Customizer: Properly change state when theme is switched. fixes <a href="http://core.trac.wordpress.org/ticket/20610">#20610</a>, see <a href="http://core.trac.wordpress.org/ticket/19910">#19910</a>.

* Causes the Manage Themes page to refresh if the customizer is closed after the active theme is switched.
* Changes the text of the 'Save and Activate' button once the theme has been activated.
* Improves the naming of the customize control settings.
* Add events to customize.Loader and make callbacks more flexible.
* Makes the customize-loader l10n compatible with non-admin settings.
* Adds WP_Customize-&gt;is_current_theme_active().
* Minor style corrections, including jQuery.attr/prop changes.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminjsthemedevjs">trunk/wp-admin/js/theme.dev.js</a></li>
<li><a href="#trunkwpincludesclasswpcustomizephp">trunk/wp-includes/class-wp-customize.php</a></li>
<li><a href="#trunkwpincludescustomizecontrolsphp">trunk/wp-includes/customize-controls.php</a></li>
<li><a href="#trunkwpincludesjscustomizecontrolsdevjs">trunk/wp-includes/js/customize-controls.dev.js</a></li>
<li><a href="#trunkwpincludesjscustomizeloaderdevjs">trunk/wp-includes/js/customize-loader.dev.js</a></li>
<li><a href="#trunkwpincludesjscustomizepreviewdevjs">trunk/wp-includes/js/customize-preview.dev.js</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
<li><a href="#trunkwpincludesthemephp">trunk/wp-includes/theme.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminjsthemedevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/theme.dev.js (20801 => 20802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/theme.dev.js        2012-05-16 05:17:26 UTC (rev 20801)
+++ trunk/wp-admin/js/theme.dev.js        2012-05-16 05:55:54 UTC (rev 20802)
</span><span class="lines">@@ -19,6 +19,35 @@
</span><span class="cx"> });
</span><span class="cx"> 
</span><span class="cx"> /**
</span><ins>+ * Theme Customizer
+ *
+ * Ensures the themes page is refreshed if the customizer switches the theme.
+ */
+jQuery( function($) {
+        var Loader, activated;
+
+        if ( typeof wp === 'undefined' || ! wp.customize || ! ( Loader = wp.customize.Loader ) )
+                return;
+
+        // Strip the current URL of its query string and hash, add activated query string.
+        activated = window.location.href.replace(/[#?].*$/, '') + '?activated=true';
+
+        // When an instance of the customizer is loaded...
+        Loader.bind( 'open', function() {
+
+                // If the customizer triggers a theme switched event,
+                // load the activated page when the customizer is closed.
+                Loader.messenger.bind( 'switched', function() {
+
+                        Loader.unbind( 'close', Loader.overlay.hide );
+                        Loader.bind( 'close', function() {
+                                window.location = activated;
+                        });
+                });
+        });
+});
+
+/**
</ins><span class="cx">  * Theme Install
</span><span class="cx">  *
</span><span class="cx">  * Displays theme previews on theme install pages.
</span></span></pre></div>
<a id="trunkwpincludesclasswpcustomizephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/class-wp-customize.php (20801 => 20802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/class-wp-customize.php        2012-05-16 05:17:26 UTC (rev 20801)
+++ trunk/wp-includes/class-wp-customize.php        2012-05-16 05:55:54 UTC (rev 20802)
</span><span class="lines">@@ -145,6 +145,15 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         /**
</span><ins>+         * Checks if the current theme is active.
+         *
+         * @since 3.4.0
+         */
+        public function is_current_theme_active() {
+                return $this-&gt;get_stylesheet() == $this-&gt;original_stylesheet;
+        }
+
+        /**
</ins><span class="cx">          * Register styles/scripts and initialize the preview of each setting
</span><span class="cx">          *
</span><span class="cx">          * @since 3.4.0
</span></span></pre></div>
<a id="trunkwpincludescustomizecontrolsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/customize-controls.php (20801 => 20802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/customize-controls.php        2012-05-16 05:17:26 UTC (rev 20801)
+++ trunk/wp-includes/customize-controls.php        2012-05-16 05:55:54 UTC (rev 20802)
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx"> 
</span><span class="cx">                 &lt;div id=&quot;customize-footer-actions&quot; class=&quot;wp-full-overlay-footer&quot;&gt;
</span><span class="cx">                         &lt;?php
</span><del>-                        $save_text = $this-&gt;get_stylesheet() == $this-&gt;original_stylesheet ? __('Save') : __('Save and Activate');
</del><ins>+                        $save_text = $this-&gt;is_current_theme_active() ? __('Save') : __('Save and Activate');
</ins><span class="cx">                         submit_button( $save_text, 'primary', 'save', false );
</span><span class="cx">                         ?&gt;
</span><span class="cx">                         &lt;img src=&quot;&lt;?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?&gt;&quot; /&gt;
</span><span class="lines">@@ -93,12 +93,17 @@
</span><span class="cx">         do_action( 'customize_controls_print_footer_scripts' );
</span><span class="cx"> 
</span><span class="cx">         $settings = array(
</span><del>-                'theme'    =&gt; $this-&gt;get_stylesheet(),
-                'preview'  =&gt; esc_url( home_url( '/' ) ),
</del><ins>+                'theme'    =&gt; array(
+                        'stylesheet' =&gt; $this-&gt;get_stylesheet(),
+                        'active'     =&gt; $this-&gt;is_current_theme_active(),
+                ),
+                'url'      =&gt; array(
+                        'preview'  =&gt; esc_url( home_url( '/' ) ),
+                        'parent'   =&gt; esc_url( admin_url() ),
+                        'ajax'     =&gt; esc_url( admin_url( 'admin-ajax.php', 'relative' ) ),
+                ),
</ins><span class="cx">                 'settings' =&gt; array(),
</span><span class="cx">                 'controls' =&gt; array(),
</span><del>-                'parent'   =&gt; esc_url( admin_url() ),
-                'ajax'     =&gt; esc_url( admin_url( 'admin-ajax.php', 'relative' ) ),
</del><span class="cx">         );
</span><span class="cx"> 
</span><span class="cx">         foreach ( $this-&gt;settings as $id =&gt; $setting ) {
</span></span></pre></div>
<a id="trunkwpincludesjscustomizecontrolsdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/customize-controls.dev.js (20801 => 20802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/customize-controls.dev.js        2012-05-16 05:17:26 UTC (rev 20801)
+++ trunk/wp-includes/js/customize-controls.dev.js        2012-05-16 05:55:54 UTC (rev 20802)
</span><span class="lines">@@ -392,6 +392,8 @@
</span><span class="cx"> 
</span><span class="cx">         $( function() {
</span><span class="cx">                 api.settings = window._wpCustomizeSettings;
</span><ins>+                api.l10n = window._wpCustomizeControlsL10n;
+
</ins><span class="cx">                 if ( ! api.settings )
</span><span class="cx">                         return;
</span><span class="cx"> 
</span><span class="lines">@@ -408,12 +410,12 @@
</span><span class="cx">                 previewer = new api.Previewer({
</span><span class="cx">                         container: '#customize-preview',
</span><span class="cx">                         form:      '#customize-controls',
</span><del>-                        url:       api.settings.preview
</del><ins>+                        url:       api.settings.url.preview
</ins><span class="cx">                 }, {
</span><span class="cx">                         query: function() {
</span><span class="cx">                                 return {
</span><span class="cx">                                         customize:  'on',
</span><del>-                                        theme:      api.settings.theme,
</del><ins>+                                        theme:      api.settings.theme.stylesheet,
</ins><span class="cx">                                         customized: JSON.stringify( api.get() )
</span><span class="cx">                                 };
</span><span class="cx">                         },
</span><span class="lines">@@ -425,8 +427,10 @@
</span><span class="cx">                                                 action: 'customize_save',
</span><span class="cx">                                                 nonce:  this.nonce
</span><span class="cx">                                         }),
</span><del>-                                        request = $.post( api.settings.ajax, query );
</del><ins>+                                        request = $.post( api.settings.url.ajax, query );
</ins><span class="cx"> 
</span><ins>+                                api.trigger( 'save', request );
+
</ins><span class="cx">                                 body.addClass('saving');
</span><span class="cx">                                 request.always( function() {
</span><span class="cx">                                         body.removeClass('saving');
</span><span class="lines">@@ -472,17 +476,37 @@
</span><span class="cx">                 });
</span><span class="cx"> 
</span><span class="cx">                 // Create a potential postMessage connection with the parent frame.
</span><del>-                parent = new api.Messenger( api.settings.parent );
</del><ins>+                parent = new api.Messenger( api.settings.url.parent );
</ins><span class="cx"> 
</span><span class="cx">                 // If we receive a 'back' event, we're inside an iframe.
</span><span class="cx">                 // Send any clicks to the 'Return' link to the parent page.
</span><span class="cx">                 parent.bind( 'back', function( text ) {
</span><del>-                        $('.back').text( text ).click( function( event ) {
</del><ins>+                        var back = $('.back');
+
+                        if ( text )
+                                back.text( text );
+
+                        back.on( 'click.back', function( event ) {
</ins><span class="cx">                                 event.preventDefault();
</span><span class="cx">                                 parent.send( 'close' );
</span><span class="cx">                         });
</span><span class="cx">                 });
</span><span class="cx"> 
</span><ins>+                // If the current theme isn't active, it will be activated on save,
+                // rendering the previous page
+                api.bind( 'save', function( request ) {
+                        request.done( function() {
+                                parent.send( 'saved' );
+
+                                if ( ! api.settings.theme.active ) {
+                                        parent.send( 'switched' );
+                                        $('#save').val( api.l10n.save );
+                                }
+
+                                api.settings.theme.active = true;
+                        });
+                } );
+
</ins><span class="cx">                 // Initialize the connection with the parent frame.
</span><span class="cx">                 parent.send( 'ready' );
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpincludesjscustomizeloaderdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/customize-loader.dev.js (20801 => 20802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/customize-loader.dev.js        2012-05-16 05:17:26 UTC (rev 20801)
+++ trunk/wp-includes/js/customize-loader.dev.js        2012-05-16 05:55:54 UTC (rev 20802)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx">         var api = wp.customize,
</span><span class="cx">                 Loader;
</span><span class="cx"> 
</span><del>-        Loader = {
</del><ins>+        Loader = $.extend( {}, api.Events, {
</ins><span class="cx">                 supports: {
</span><span class="cx">                         history:  !! ( window.history &amp;&amp; history.pushState ),
</span><span class="cx">                         hashchange: ('onhashchange' in window) &amp;&amp; (document.documentMode === undefined || document.documentMode &gt; 7)
</span><span class="lines">@@ -16,6 +16,9 @@
</span><span class="cx">                         this.window  = $( window );
</span><span class="cx">                         this.element = $( '&lt;div id=&quot;customize-container&quot; class=&quot;wp-full-overlay&quot; /&gt;' ).appendTo( this.body );
</span><span class="cx"> 
</span><ins>+                        this.bind( 'open', this.overlay.show );
+                        this.bind( 'close', this.overlay.hide );
+
</ins><span class="cx">                         $('#wpbody').on( 'click', '.load-customize', function( event ) {
</span><span class="cx">                                 event.preventDefault();
</span><span class="cx"> 
</span><span class="lines">@@ -30,6 +33,7 @@
</span><span class="cx">                         if ( this.supports.hashchange )
</span><span class="cx">                                 this.window.on( 'hashchange', Loader.hashchange );
</span><span class="cx">                 },
</span><ins>+
</ins><span class="cx">                 popstate: function( e ) {
</span><span class="cx">                         var state = e.originalEvent.state;
</span><span class="cx">                         if ( state &amp;&amp; state.customize )
</span><span class="lines">@@ -37,6 +41,7 @@
</span><span class="cx">                         else if ( Loader.active )
</span><span class="cx">                                 Loader.close();
</span><span class="cx">                 },
</span><ins>+
</ins><span class="cx">                 hashchange: function( e ) {
</span><span class="cx">                         var hash = window.location.toString().split('#')[1];
</span><span class="cx"> 
</span><span class="lines">@@ -46,9 +51,13 @@
</span><span class="cx">                         if ( ! hash &amp;&amp; ! Loader.supports.history )
</span><span class="cx">                                 Loader.close();
</span><span class="cx">                 },
</span><ins>+
</ins><span class="cx">                 open: function( src ) {
</span><ins>+                        var hash;
+
</ins><span class="cx">                         if ( this.active )
</span><span class="cx">                                 return;
</span><ins>+
</ins><span class="cx">                         this.active = true;
</span><span class="cx">                         this.body.addClass('customize-loading');
</span><span class="cx"> 
</span><span class="lines">@@ -60,7 +69,7 @@
</span><span class="cx"> 
</span><span class="cx">                         // Wait for the connection from the iframe before sending any postMessage events.
</span><span class="cx">                         this.messenger.bind( 'ready', function() {
</span><del>-                                Loader.messenger.send( 'back', wpCustomizeLoaderL10n.back );
</del><ins>+                                Loader.messenger.send( 'back', wpCustomizeLoaderL10n.back || '' );
</ins><span class="cx">                         });
</span><span class="cx"> 
</span><span class="cx">                         this.messenger.bind( 'close', function() {
</span><span class="lines">@@ -72,35 +81,51 @@
</span><span class="cx">                                         Loader.close();
</span><span class="cx">                         });
</span><span class="cx"> 
</span><del>-                        this.element.fadeIn( 200, function() {
-                                var hash = src.split('?')[1];
</del><ins>+                        hash = src.split('?')[1];
</ins><span class="cx"> 
</span><del>-                                Loader.body.addClass( 'customize-active full-overlay-active' );
</del><ins>+                        // Ensure we don't call pushState if the user hit the forward button.
+                        if ( Loader.supports.history &amp;&amp; window.location.href !== src )
+                                history.pushState( { customize: src }, '', src );
+                        else if ( ! Loader.supports.history &amp;&amp; Loader.supports.hashchange &amp;&amp; hash )
+                                window.location.hash = hash;
</ins><span class="cx"> 
</span><del>-                                // Ensure we don't call pushState if the user hit the forward button.
-                                if ( Loader.supports.history &amp;&amp; window.location.href !== src )
-                                        history.pushState( { customize: src }, '', src );
-                                else if ( ! Loader.supports.history &amp;&amp; Loader.supports.hashchange &amp;&amp; hash )
-                                        window.location.hash = hash;
-                        });
</del><ins>+                        this.trigger( 'open' );
</ins><span class="cx">                 },
</span><ins>+
+                opened: function() {
+                        Loader.body.addClass( 'customize-active full-overlay-active' );
+                },
+
</ins><span class="cx">                 close: function() {
</span><span class="cx">                         if ( ! this.active )
</span><span class="cx">                                 return;
</span><span class="cx">                         this.active = false;
</span><span class="cx"> 
</span><del>-                        this.element.fadeOut( 200, function() {
-                                Loader.iframe.remove();
-                                Loader.messenger.destroy();
-                                Loader.iframe    = null;
-                                Loader.messenger = null;
-                                Loader.body.removeClass( 'customize-active full-overlay-active' ).removeClass( 'customize-loading' );
-                        });
</del><ins>+                        this.trigger( 'close' );
</ins><span class="cx">                 },
</span><ins>+
+                closed: function() {
+                        Loader.iframe.remove();
+                        Loader.messenger.destroy();
+                        Loader.iframe    = null;
+                        Loader.messenger = null;
+                        Loader.body.removeClass( 'customize-active full-overlay-active' ).removeClass( 'customize-loading' );
+                },
+
</ins><span class="cx">                 loaded: function() {
</span><span class="cx">                         Loader.body.removeClass('customize-loading');
</span><ins>+                },
+
+                overlay: {
+                        show: function() {
+                                this.element.fadeIn( 200, Loader.opened );
+                        },
+
+                        hide: function() {
+                                this.element.fadeOut( 200, Loader.closed );
+                        }
</ins><span class="cx">                 }
</span><del>-        };
</del><ins>+        });
</ins><span class="cx"> 
</span><span class="cx">         $( function() {
</span><span class="cx">                 if ( window.postMessage )
</span></span></pre></div>
<a id="trunkwpincludesjscustomizepreviewdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/customize-preview.dev.js (20801 => 20802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/customize-preview.dev.js        2012-05-16 05:17:26 UTC (rev 20801)
+++ trunk/wp-includes/js/customize-preview.dev.js        2012-05-16 05:55:54 UTC (rev 20802)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx">                         this.body = $( document.body );
</span><span class="cx">                         this.body.on( 'click.preview', 'a', function( event ) {
</span><span class="cx">                                 event.preventDefault();
</span><del>-                                self.send( 'url', $(this).attr('href') );
</del><ins>+                                self.send( 'url', $(this).prop('href') );
</ins><span class="cx">                         });
</span><span class="cx"> 
</span><span class="cx">                         // You cannot submit forms.
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx">                 preview.bind( 'setting', function( args ) {
</span><span class="cx">                         var value = api( args.shift() );
</span><span class="cx">                         if ( value )
</span><del>-                                value.apply( value, args );
</del><ins>+                                value.set.apply( value, args );
</ins><span class="cx">                 });
</span><span class="cx"> 
</span><span class="cx">                 body = $(document.body);
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (20801 => 20802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2012-05-16 05:17:26 UTC (rev 20801)
+++ trunk/wp-includes/script-loader.php        2012-05-16 05:55:54 UTC (rev 20802)
</span><span class="lines">@@ -299,8 +299,11 @@
</span><span class="cx"> 
</span><span class="cx">         $scripts-&gt;add( 'customize-base',     &quot;/wp-includes/js/customize-base$suffix.js&quot;,     array( 'jquery', 'json2' ), false, 1 );
</span><span class="cx">         $scripts-&gt;add( 'customize-loader',   &quot;/wp-includes/js/customize-loader$suffix.js&quot;,   array( 'customize-base' ), false, 1 );
</span><ins>+        $scripts-&gt;add( 'customize-preview',  &quot;/wp-includes/js/customize-preview$suffix.js&quot;,  array( 'customize-base' ), false, 1 );
</ins><span class="cx">         $scripts-&gt;add( 'customize-controls', &quot;/wp-includes/js/customize-controls$suffix.js&quot;, array( 'customize-base' ), false, 1 );
</span><del>-        $scripts-&gt;add( 'customize-preview',  &quot;/wp-includes/js/customize-preview$suffix.js&quot;,  array( 'customize-base' ), false, 1 );
</del><ins>+        $scripts-&gt;localize( 'customize-controls', '_wpCustomizeControlsL10n', array(
+                'save' =&gt; __( 'Save' ),
+        ) );
</ins><span class="cx"> 
</span><span class="cx">         if ( is_admin() ) {
</span><span class="cx">                 $scripts-&gt;add( 'ajaxcat', &quot;/wp-admin/js/cat$suffix.js&quot;, array( 'wp-lists' ) );
</span></span></pre></div>
<a id="trunkwpincludesthemephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/theme.php (20801 => 20802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/theme.php        2012-05-16 05:17:26 UTC (rev 20801)
+++ trunk/wp-includes/theme.php        2012-05-16 05:55:54 UTC (rev 20802)
</span><span class="lines">@@ -1589,10 +1589,12 @@
</span><span class="cx">  * @since 3.4.0
</span><span class="cx">  */
</span><span class="cx"> function _wp_customize_loader_localize() {
</span><del>-        wp_localize_script( 'customize-loader', 'wpCustomizeLoaderL10n', array(
-                'back' =&gt; sprintf( __( '&amp;larr; Return to %s' ), get_admin_page_title() ),
-                'url'  =&gt; admin_url( 'admin.php' ),
-        ) );
</del><ins>+        $l10n = array( 'url'  =&gt; admin_url( 'admin.php' ) );
+
+        if ( is_admin() )
+                $l10n[ 'back' ] = sprintf( __( '&amp;larr; Return to %s' ), get_admin_page_title() );
+
+        wp_localize_script( 'customize-loader', 'wpCustomizeLoaderL10n', $l10n );
</ins><span class="cx"> }
</span><span class="cx"> add_action( 'admin_enqueue_scripts', '_wp_customize_loader_localize' );
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>