Ticket #46134: 43164.1.2.diff
File 43164.1.2.diff, 1.4 KB (added by , 3 years ago) |
---|
-
src/wp-includes/theme.php
1198 1198 * @return string HTML image element markup or empty string on failure. 1199 1199 */ 1200 1200 function get_header_image_tag( $attr = array() ) { 1201 $header 1202 $header ->url = get_header_image();1201 $header = get_custom_header(); 1202 $header_url = get_header_image(); 1203 1203 1204 if ( ! $header ->url ) {1204 if ( ! $header_url ) { 1205 1205 return ''; 1206 1206 } 1207 1207 … … 1211 1211 $attr = wp_parse_args( 1212 1212 $attr, 1213 1213 array( 1214 'src' => $header ->url,1214 'src' => $header_url, 1215 1215 'width' => $width, 1216 1216 'height' => $height, 1217 1217 'alt' => get_bloginfo( 'name' ), … … 1224 1224 $size_array = array( $width, $height ); 1225 1225 1226 1226 if ( is_array( $image_meta ) ) { 1227 $srcset = wp_calculate_image_srcset( $size_array, $header ->url, $image_meta, $header->attachment_id );1228 $sizes = ! empty( $attr['sizes'] ) ? $attr['sizes'] : wp_calculate_image_sizes( $size_array, $header ->url, $image_meta, $header->attachment_id );1227 $srcset = wp_calculate_image_srcset( $size_array, $header_url, $image_meta, $header->attachment_id ); 1228 $sizes = ! empty( $attr['sizes'] ) ? $attr['sizes'] : wp_calculate_image_sizes( $size_array, $header_url, $image_meta, $header->attachment_id ); 1229 1229 1230 1230 if ( $srcset && $sizes ) { 1231 1231 $attr['srcset'] = $srcset;