diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index b817edec4f..3765e9873c 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -773,7 +773,8 @@ function get_body_class( $class = '' ) { $classes[] = 'no-customize-support'; } - if ( get_background_color() !== get_theme_support( 'custom-background', 'default-color' ) || get_background_image() ) { + if ( current_theme_supports( 'custom-background' ) + && ( get_background_color() !== get_theme_support( 'custom-background', 'default-color' ) || get_background_image() ) ) { $classes[] = 'custom-background'; } diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 9a72126488..23907bc549 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -2730,7 +2730,9 @@ function _remove_theme_support( $feature ) { break; } $support = get_theme_support( 'custom-background' ); - remove_action( 'wp_head', $support[0]['wp-head-callback'] ); + if ( isset( $support[0]['wp-head-callback'] ) ) { + remove_action( 'wp_head', $support[0]['wp-head-callback'] ); + } remove_action( 'admin_menu', array( $GLOBALS['custom_background'], 'init' ) ); unset( $GLOBALS['custom_background'] ); break; diff --git a/wp-includes/version.php b/wp-includes/version.php index 063c299588..6d1b73ecef 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.2-beta1-45087'; +$wp_version = '5.2-beta1-45088'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.