From 6740130925e4ca63ef66a685bf2ef0a2a6649b36 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Wed, 9 Mar 2016 19:32:33 +0000 Subject: [PATCH] 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 --- src/wp-includes/js/customize-preview.js | 2 ++ src/wp-includes/post-template.php | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/wp-includes/js/customize-preview.js b/src/wp-includes/js/customize-preview.js index 8d1d759be9..39ac5f4be1 100644 --- a/src/wp-includes/js/customize-preview.js +++ b/src/wp-includes/js/customize-preview.js @@ -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' ); } } ); diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php index c162ca1c6d..3f5fdc8c27 100644 --- a/src/wp-includes/post-template.php +++ b/src/wp-includes/post-template.php @@ -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 )