From 26ff50699802b40d1195a0946e82195354b5a6aa Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 5 Jun 2012 18:44:31 +0000 Subject: [PATCH] Add some comments to _custom_background_cb() to explain the logic. see #20448. git-svn-id: https://develop.svn.wordpress.org/trunk@21002 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/theme.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 409982c0e9..455fa94dbb 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1102,7 +1102,11 @@ function background_color() { * @access protected */ function _custom_background_cb() { + // $background is the saved custom image, or the default image. $background = get_background_image(); + + // $color is the saved custom color. + // A default has to be specified in style.css. It will not be printed here. $color = get_theme_mod( 'background_color' ); if ( ! $background && ! $color && ! get_theme_support( 'custom-background', 'default-image' ) ) @@ -1130,6 +1134,8 @@ function _custom_background_cb() { $style .= $image . $repeat . $position . $attachment; } elseif ( get_theme_support( 'custom-background', 'default-image' ) ) { + // If there is not a $background, but there is a default, then the default was + // removed and an empty value was saved. Remove it: $style .= " background-image: none;"; } ?>