Skip to content
Permalink
Browse files

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
  • Loading branch information...
SergeyBiryukov committed Sep 23, 2019
1 parent a9fb2f6 commit d88473fa2fdebeb592f3032fe1dfc68ca9d6d4d5
Showing with 2 additions and 3 deletions.
  1. +2 −3 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( '<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">

0 comments on commit d88473f

Please sign in to comment.
You can’t perform that action at this time.