Make WordPress Core

Ticket #29071: 29071.3.diff

File 29071.3.diff, 1.5 KB (added by ericlewis, 12 years ago)
  • src/wp-admin/customize.php

    diff --git a/src/wp-admin/customize.php b/src/wp-admin/customize.php
    index 3cfa0c7..33c167c 100644
    a b do_action( 'customize_controls_print_scripts' );  
    228228
    229229        // Prepare customizer settings to pass to Javascript.
    230230        $settings = array(
     231                'isDefaultCustomizerInstance' => true,
    231232                'theme'    => array(
    232233                        'stylesheet' => $wp_customize->get_stylesheet(),
    233234                        'active'     => $wp_customize->is_theme_active(),
  • src/wp-admin/js/customize-controls.js

    diff --git a/src/wp-admin/js/customize-controls.js b/src/wp-admin/js/customize-controls.js
    index 85b171d..919309b 100644
    a b  
    980980                header: api.HeaderControl
    981981        };
    982982
    983         $( function() {
     983        /**
     984         * Bootstraps the default customizer instance (on customize.php).
     985         */
     986        var bootstrapDefaultCustomizerInstance = function() {
    984987                api.settings = window._wpCustomizeSettings;
    985988                api.l10n = window._wpCustomizeControlsL10n;
    986989
    … …  
    988991                if ( ! api.settings )
    989992                        return;
    990993
     994                if ( ! api.settings.isDefaultCustomizerInstance )
     995                        return;
     996
    991997                // Redirect to the fallback preview if any incompatibilities are found.
    992998                if ( ! $.support.postMessage || ( ! $.support.cors && api.settings.isCrossDomain ) )
    993999                        return window.location = api.settings.url.fallback;
    … …  
    12991305                setTimeout(function () {
    13001306                        topFocus.focus();
    13011307                }, 200);
     1308        };
    13021309
    1303         });
     1310        $( bootstrapDefaultCustomizerInstance );
    13041311
    1305 })( wp, jQuery );
     1312})( wp, jQuery );
     1313 No newline at end of file