Make WordPress Core


Ignore:
Timestamp:
07/05/2023 07:28:02 PM (5 months ago)
Author:
flixos90
Message:

Media: Ensure custom header image tag supports loading optimization attributes.

This changeset is a follow up to [56037] and ensures that the get_header_image_tag() function receives the benefits of wp_get_loading_optimization_attributes() as well. Prior to fetchpriority support, this was not needed since the header image should never be lazy-loaded, but the image certainly is a fetchpriority candidate, so therefore it is crucial to have it supported.

Props felipeelia, spacedmonkey, mukesh27, westonruter, flixos90.
Fixes #58680.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r56122 r56142  
    56445644    }
    56455645
     5646    // The custom header image is always expected to be in the header.
     5647    if ( 'get_header_image_tag' === $context ) {
     5648        return $postprocess( $loading_attrs, true );
     5649    }
     5650
    56465651    // Special handling for programmatically created image tags.
    56475652    if ( 'the_post_thumbnail' === $context || 'wp_get_attachment_image' === $context ) {
Note: See TracChangeset for help on using the changeset viewer.