Ticket #32772: 32772.patch
| File 32772.patch, 1.6 KB (added by , 11 years ago) |
|---|
-
theme.php
2066 2066 $admin_origin = parse_url( admin_url() ); 2067 2067 $home_origin = parse_url( home_url() ); 2068 2068 $cross_domain = ( strtolower( $admin_origin[ 'host' ] ) != strtolower( $home_origin[ 'host' ] ) ); 2069 2069 /** 2070 * Filter whether to enable the Customizer. 2071 * 2072 * Returning false to this hook will trigger the 'no-customizer-support' 2073 * class within the body tag which will effectively revert the inclusion 2074 * of the Customizer. 2075 * 2076 * @since 4.x.x 2077 * 2078 * @param bool Whether the Customizer should be shown. Default true. 2079 */ 2080 $enabled = apply_filters( 'enable_customizer_support', true ); 2070 2081 ?> 2071 2082 <script type="text/javascript"> 2072 2083 (function() { 2073 var request, b = document.body, c = 'className', cs = 'customize-support', rcs = new RegExp('(^|\\s+)(no-)?'+cs+'(\\s+|$)');2084 var request, enabled, b = document.body, c = 'className', cs = 'customize-support', rcs = new RegExp('(^|\\s+)(no-)?'+cs+'(\\s+|$)'); 2074 2085 2075 2086 <?php if ( $cross_domain ): ?> 2076 2087 request = (function(){ var xhr = new XMLHttpRequest(); return ('withCredentials' in xhr); })(); … … 2077 2088 <?php else: ?> 2078 2089 request = true; 2079 2090 <?php endif; ?> 2091 <?php if ( $enabled ) { ?> 2092 enabled = true; 2093 <?php } else { ?> 2094 enabled = false; 2095 <?php } ?> 2080 2096 2081 2097 b[c] = b[c].replace( rcs, ' ' ); 2082 b[c] += ( window.postMessage && request ? ' ' : ' no-' ) + cs;2098 b[c] += ( window.postMessage && request && enabled ? ' ' : ' no-' ) + cs; 2083 2099 }()); 2084 2100 </script> 2085 2101 <?php