From d4c4205f313e7e2c7d9db9b1849dab3c6171cf36 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 10 Jan 2015 21:07:54 +0000 Subject: [PATCH] `get_header_image()` can return `false`. In `Custom_Image_Header->step_1()`, check the value before setting the `background-image` portion of the `style` attribute. Setting the the URL to empty string will cause the current request to be set as the source of the background image. See #30799. git-svn-id: https://develop.svn.wordpress.org/trunk@31130 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/custom-header.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/custom-header.php b/src/wp-admin/custom-header.php index 623a1fad29..eee3f1f1a6 100644 --- a/src/wp-admin/custom-header.php +++ b/src/wp-admin/custom-header.php @@ -554,7 +554,14 @@ class Custom_Image_Header { call_user_func( $this->admin_image_div_callback ); } else { $custom_header = get_custom_header(); - $header_image_style = 'background-image:url(' . esc_url( get_header_image() ) . ');'; + $header_image = get_header_image(); + + if ( $header_image ) { + $header_image_style = 'background-image:url(' . esc_url( $header_image ) . ');'; + } else { + $header_image_style = ''; + } + if ( $custom_header->width ) $header_image_style .= 'max-width:' . $custom_header->width . 'px;'; if ( $custom_header->height )