Twenty Twelve and Thirteen: Use proper way to get customizer settings values.
Props obenland, kdoran. Fixes #29577. Built from https://develop.svn.wordpress.org/trunk@30482 git-svn-id: http://core.svn.wordpress.org/trunk@30470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6c70cd9951
commit
330e97d663
|
@ -494,6 +494,6 @@ add_action( 'customize_register', 'twentytwelve_customize_register' );
|
||||||
* @since Twenty Twelve 1.0
|
* @since Twenty Twelve 1.0
|
||||||
*/
|
*/
|
||||||
function twentytwelve_customize_preview_js() {
|
function twentytwelve_customize_preview_js() {
|
||||||
wp_enqueue_script( 'twentytwelve-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20130301', true );
|
wp_enqueue_script( 'twentytwelve-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20141120', true );
|
||||||
}
|
}
|
||||||
add_action( 'customize_preview_init', 'twentytwelve_customize_preview_js' );
|
add_action( 'customize_preview_init', 'twentytwelve_customize_preview_js' );
|
||||||
|
|
|
@ -53,12 +53,13 @@
|
||||||
value.bind( function( to ) {
|
value.bind( function( to ) {
|
||||||
var body = $( 'body' );
|
var body = $( 'body' );
|
||||||
|
|
||||||
if ( '' != to )
|
if ( '' !== to ) {
|
||||||
body.removeClass( 'custom-background-empty custom-background-white' );
|
body.removeClass( 'custom-background-empty custom-background-white' );
|
||||||
else if ( 'rgb(255, 255, 255)' == body.css( 'background-color' ) )
|
} else if ( 'rgb(255, 255, 255)' === body.css( 'background-color' ) ) {
|
||||||
body.addClass( 'custom-background-white' );
|
body.addClass( 'custom-background-white' );
|
||||||
else if ( 'rgb(230, 230, 230)' == body.css( 'background-color' ) && '' == _wpCustomizeSettings.values.background_color )
|
} else if ( 'rgb(230, 230, 230)' === body.css( 'background-color' ) && '' === wp.customize.instance( 'background_color' ).get() ) {
|
||||||
body.addClass( 'custom-background-empty' );
|
body.addClass( 'custom-background-empty' );
|
||||||
|
}
|
||||||
} );
|
} );
|
||||||
} );
|
} );
|
||||||
} )( jQuery );
|
} )( jQuery );
|
||||||
|
|
Loading…
Reference in New Issue