From d88473fa2fdebeb592f3032fe1dfc68ca9d6d4d5 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 23 Sep 2019 20:08:04 +0000 Subject: [PATCH] Themes: After [46164], make sure `$type_attr` is always defined in `_custom_background_cb()`. Props davidbaumwald. Fixes #48112. git-svn-id: https://develop.svn.wordpress.org/trunk@46270 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/theme.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php index e4cc8802f5..e0539b2681 100644 --- a/src/wp-includes/theme.php +++ b/src/wp-includes/theme.php @@ -1646,9 +1646,10 @@ function _custom_background_cb() { $color = false; } + $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"'; + if ( ! $background && ! $color ) { if ( is_customize_preview() ) { - $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"'; printf( '', $type_attr ); } return; @@ -1701,8 +1702,6 @@ function _custom_background_cb() { $attachment = " background-attachment: $attachment;"; $style .= $image . $position . $size . $repeat . $attachment; - - $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"'; } ?> id="custom-background-css">