mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Fix removing the default background image for themes that hard-code the default in css. Honor the default background image for themes that do not provide a fallback in css.
* <style> will appear if there is a default image registered. This is the same as 3.3. * If only a default color is registered, it still assumes it is in the stylesheet, and no <style> will appear. This is a change from 3.3. * <style> will continue to appear as before if there is a custom background color or image. This is the same as 3.3. * This then allows for a default background image with background-image: none, overriding style.css. This is new. Props nacin see #20448 git-svn-id: https://develop.svn.wordpress.org/trunk@21001 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1102,10 +1102,10 @@ function background_color() {
|
||||
* @access protected
|
||||
*/
|
||||
function _custom_background_cb() {
|
||||
$background = get_theme_mod( 'background_image' );
|
||||
$background = get_background_image();
|
||||
$color = get_theme_mod( 'background_color' );
|
||||
|
||||
if ( ! $background && ! $color )
|
||||
if ( ! $background && ! $color && ! get_theme_support( 'custom-background', 'default-image' ) )
|
||||
return;
|
||||
|
||||
$style = $color ? "background-color: #$color;" : '';
|
||||
@@ -1129,6 +1129,8 @@ function _custom_background_cb() {
|
||||
$attachment = " background-attachment: $attachment;";
|
||||
|
||||
$style .= $image . $repeat . $position . $attachment;
|
||||
} elseif ( get_theme_support( 'custom-background', 'default-image' ) ) {
|
||||
$style .= " background-image: none;";
|
||||
}
|
||||
?>
|
||||
<style type="text/css" id="custom-background-css">
|
||||
|
||||
Reference in New Issue
Block a user