From 0f54cc95b3232eaae7e27afd152e31a33af67cda Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 10 Jan 2015 20:43:12 +0000 Subject: [PATCH] Since `get_theme_mod()` returns `false` on failure, `$background_image_thumb` can be set to it and checked instead of calling `get_background_image()` 3 times in `Custom_Background->admin_page()`. See #30799. git-svn-id: https://develop.svn.wordpress.org/trunk@31129 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/custom-background.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/custom-background.php b/src/wp-admin/custom-background.php index 0c515c22f9..cbc96bc396 100644 --- a/src/wp-admin/custom-background.php +++ b/src/wp-admin/custom-background.php @@ -278,8 +278,9 @@ class Custom_Background { if ( $bgcolor = get_background_color() ) $background_styles .= 'background-color: #' . $bgcolor . ';'; - if ( get_background_image() ) { - $background_image_thumb = esc_url( set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', get_background_image() ) ) ) ); + $background_image_thumb = get_background_image(); + if ( $background_image_thumb ) { + $background_image_thumb = esc_url( set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', $background_image_thumb ) ) ) ); // Background-image URL must be single quote, see below. $background_styles .= ' background-image: url(\'' . $background_image_thumb . '\');' @@ -288,7 +289,7 @@ class Custom_Background { } ?>
- +