Ticket #20582: cors-test.patch
File cors-test.patch, 1.8 KB (added by , 13 years ago) |
---|
-
wp-includes/js/customize-loader.dev.js
8 8 Loader = $.extend( {}, api.Events, { 9 9 supports: { 10 10 history: !! ( window.history && history.pushState ), 11 hashchange: ('onhashchange' in window) && (document.documentMode === undefined || document.documentMode > 7) 11 hashchange: ('onhashchange' in window) && (document.documentMode === undefined || document.documentMode > 7), 12 cors: (function(){ var xhr = new XMLHttpRequest(); return ( 'withCredentials' in xhr ); })() 12 13 }, 13 14 14 15 initialize: function() { … … 128 129 }); 129 130 130 131 $( function() { 132 var url, home; 133 134 if ( ! Loader.supports.cors ) { 135 url = wpCustomizeLoaderL10n.url.replace(/https?:\/\//, ''); 136 home = wpCustomizeLoaderL10n.home.replace(/https?:\/\//, ''); 137 138 if ( url.indexOf( home ) == -1 ) { 139 // no cors and x-domain, bail 140 } 141 } 142 131 143 if ( window.postMessage ) 132 144 Loader.initialize(); 133 145 }); -
wp-includes/theme.php
1589 1589 * @since 3.4.0 1590 1590 */ 1591 1591 function _wp_customize_loader_localize() { 1592 $l10n = array( 'url' => admin_url( 'admin.php' ) );1592 $l10n = array( 'url' => admin_url( 'admin.php' ), 'home' => home_url() ); 1593 1593 1594 1594 if ( is_admin() ) 1595 1595 $l10n[ 'back' ] = sprintf( __( '← Return to %s' ), get_admin_page_title() ); … … 1605 1605 */ 1606 1606 function wp_customize_url( $stylesheet ) { 1607 1607 return esc_url( admin_url( 'customize.php' ) . '?theme=' . $stylesheet ); 1608 } 1609 No newline at end of file 1608 }