Message info
 
To:wp-svn@lists.automattic.com From:m@wordpress.org Subject:[wp-svn] [21002] trunk/wp-includes/theme.php: Add some comments to _custom_background_cb() to explain the logic. Date:Tue, 5 Jun 2012 18:44:31 +0000 (UTC)
 

Revision
21002
Author
nacin
Date
2012-06-05 18:44:31 +0000 (Tue, 05 Jun 2012)

Log Message

Add some comments to _custom_background_cb() to explain the logic. see #20448.

Modified Paths

Diff

Modified: trunk/wp-includes/theme.php (21001 => 21002)


--- trunk/wp-includes/theme.php	2012-06-05 18:35:31 UTC (rev 21001)
+++ trunk/wp-includes/theme.php	2012-06-05 18:44:31 UTC (rev 21002)
@@ -1102,7 +1102,11 @@
  * @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 @@
 
 		$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;";
 	}
 ?>