Customize: Restore body class removed in [36837] for when custom logo is present.

The class name is `wp-custom-logo` and it will be toggled by JS in the Customizer preview when the custom logo is added or removed.

See #33755.
Fixes #35945.


git-svn-id: https://develop.svn.wordpress.org/trunk@36903 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter 2016-03-09 19:32:33 +00:00
parent 11c47a6cb5
commit 6740130925
2 changed files with 6 additions and 0 deletions

View File

@ -256,12 +256,14 @@
} );
$( '.custom-logo-link' ).show();
$( 'body' ).addClass( 'wp-custom-logo' );
} );
api( 'custom_logo', function( setting ) {
setting.bind( function( newValue ) {
if ( ! newValue ) {
$( '.custom-logo-link' ).hide();
$( 'body' ).removeClass( 'wp-custom-logo' );
}
} );

View File

@ -706,6 +706,10 @@ function get_body_class( $class = '' ) {
if ( get_background_color() !== get_theme_support( 'custom-background', 'default-color' ) || get_background_image() )
$classes[] = 'custom-background';
if ( has_custom_logo() ) {
$classes[] = 'wp-custom-logo';
}
$page = $wp_query->get( 'page' );
if ( ! $page || $page < 2 )