Themes: After [46164], make sure `$type_attr` is always defined in `_custom_background_cb()`.

Props davidbaumwald.
Fixes #48112.
Built from https://develop.svn.wordpress.org/trunk@46270


git-svn-id: http://core.svn.wordpress.org/trunk@46082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-09-23 20:09:57 +00:00
parent 371f83cfd1
commit d363d85cce
2 changed files with 3 additions and 4 deletions

View File

@ -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( '<style%s id="custom-background-css"></style>', $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"';
}
?>
<style<?php echo $type_attr; ?> id="custom-background-css">

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-alpha-46269';
$wp_version = '5.3-alpha-46270';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.