From 60db5df85fef70eb6615c9c7dda6a78ab95e9fb1 Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Fri, 4 Nov 2016 17:09:02 +0000 Subject: [PATCH] Themes: Improve reliability of URL used in `get_header_image_tag()`. `get_header_image_tag()` relies on the data returned by `get_custom_header()` to build the attributes for the header `` element. However, `get_custom_header()` relies on data from the `header_image_data` theme mod rather than the `header_image` theme mod that `get_header_image()` uses. This can create inconsistencies when no header image is set, but a theme supports a default header image. This fixes the issue by making `get_custom_image_tag()` rely on the URL returned by `get_header_image()` instead. Props bradyvercher. Fixes #38633. Built from https://develop.svn.wordpress.org/trunk@39121 git-svn-id: http://core.svn.wordpress.org/trunk@39061 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/theme.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 957ee1b00d..450b985879 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -1027,8 +1027,9 @@ function get_header_image() { */ function get_header_image_tag( $attr = array() ) { $header = get_custom_header(); + $header->url = get_header_image(); - if ( empty( $header->url ) ) { + if ( ! $header->url ) { return ''; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 3e988781f7..a94997c9aa 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-beta1-39120'; +$wp_version = '4.7-beta1-39121'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.