Changeset 35595 for trunk/src/wp-includes/theme.php
- Timestamp:
- 11/10/2015 01:58:38 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/theme.php
r35594 r35595 995 995 996 996 /** 997 * Create image markup for a custom header image.997 * Create image tag markup for a custom header image. 998 998 * 999 999 * @since 4.4.0 1000 1000 * 1001 * @param array $attr Optional. Attributes for the image markup. Default empty. 1002 * @return string HTML element or empty string on failure. 1001 * @param array $attr Optional. Additional attributes for the image tag. Can be used 1002 * to override the default attributes. Default empty. 1003 * @return string HTML image element markup or empty string on failure. 1003 1004 */ 1004 1005 function get_header_image_tag( $attr = array() ) { … … 1028 1029 1029 1030 if ( is_array( $image_meta ) ) { 1030 $srcset = wp_calculate_image_srcset( $ header->url, $size_array, $image_meta, $header->attachment_id );1031 $sizes = wp_get_attachment_image_sizes( $size_array, $image_meta, $header->attachment_id, $header->url);1032 1033 if ( $srcset && ( $sizes || ! empty( $attr['sizes'] ) )) {1031 $srcset = wp_calculate_image_srcset( $size_array, $header->url, $image_meta, $header->attachment_id ); 1032 $sizes = ! empty( $attr['sizes'] ) ? $attr['sizes'] : wp_calculate_image_sizes( $size_array, $header->url, $image_meta, $header->attachment_id ); 1033 1034 if ( $srcset && $sizes ) { 1034 1035 $attr['srcset'] = $srcset; 1035 1036 if ( empty( $attr['sizes'] ) ) { 1037 $attr['sizes'] = $sizes; 1038 } 1036 $attr['sizes'] = $sizes; 1039 1037 } 1040 1038 } … … 1055 1053 * @since 4.4.0 1056 1054 * 1057 * @param string $html The HTML markup being filtered.1058 * @param object $header The custom header object returned by 'get_custom_header()' 1059 * @param array $attr A n array of attributes for the image markup.1055 * @param string $html The HTML image tag markup being filtered. 1056 * @param object $header The custom header object returned by 'get_custom_header()'. 1057 * @param array $attr Array of the attributes for the image tag. 1060 1058 */ 1061 1059 return apply_filters( 'get_header_image_tag', $html, $header, $attr );
Note: See TracChangeset
for help on using the changeset viewer.