mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 14:35:07 +00:00
Add some comments to _custom_background_cb() to explain the logic. see #20448.
git-svn-id: http://core.svn.wordpress.org/trunk@21002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
64e6663569
commit
5cba80ee25
@ -1102,7 +1102,11 @@ function background_color() {
|
|||||||
* @access protected
|
* @access protected
|
||||||
*/
|
*/
|
||||||
function _custom_background_cb() {
|
function _custom_background_cb() {
|
||||||
|
// $background is the saved custom image, or the default image.
|
||||||
$background = get_background_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' );
|
$color = get_theme_mod( 'background_color' );
|
||||||
|
|
||||||
if ( ! $background && ! $color && ! get_theme_support( 'custom-background', 'default-image' ) )
|
if ( ! $background && ! $color && ! get_theme_support( 'custom-background', 'default-image' ) )
|
||||||
@ -1130,6 +1134,8 @@ function _custom_background_cb() {
|
|||||||
|
|
||||||
$style .= $image . $repeat . $position . $attachment;
|
$style .= $image . $repeat . $position . $attachment;
|
||||||
} elseif ( get_theme_support( 'custom-background', 'default-image' ) ) {
|
} 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;";
|
$style .= " background-image: none;";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user