Make WordPress Core

Ticket #38847: 38847.2.patch

File 38847.2.patch, 1.1 KB (added by davidakennedy, 9 years ago)

Updates @since block.

  • src/wp-content/themes/twentyseventeen/functions.php

     
    425425add_filter( 'wp_calculate_image_sizes', 'twentyseventeen_content_image_sizes_attr', 10, 2 );
    426426
    427427/**
     428 * Filter the `sizes` value in the header image markup.
     429 *
     430 * @since Twenty Seventeen 1.0
     431 *
     432 * @param string $html   The HTML image tag markup being filtered.
     433 * @param object $header The custom header object returned by 'get_custom_header()'.
     434 * @param array  $attr   Array of the attributes for the image tag.
     435 * @return string The filtered header image HTML.
     436 */
     437function twentyseventeen_header_image_tag( $html, $header, $attr ) {
     438        return str_replace( $attr['sizes'], '100vw', $html );
     439}
     440add_filter ( 'get_header_image_tag', 'twentyseventeen_header_image_tag', 10, 3 );
     441
     442/**
    428443 * Add custom image sizes attribute to enhance responsive image functionality
    429444 * for post thumbnails.
    430445 *