[wp-trac] [WordPress Trac] #58680: Header image does not add fetch priority attribute
WordPress Trac
noreply at wordpress.org
Fri Jun 30 09:28:40 UTC 2023
#58680: Header image does not add fetch priority attribute
--------------------------+-----------------------------
Reporter: spacedmonkey | Owner: (none)
Type: defect (bug) | Status: new
Priority: high | Milestone: Future Release
Component: Media | Version: trunk
Severity: normal | Resolution:
Keywords: | Focuses: performance
--------------------------+-----------------------------
Old description:
> Added in #58235 ( [56037] ), fetch priority was added so add fetch
> priority attribute to large images at the start of the page. However, the
> custom header functionality built in WordPress support not support adding
> this attribute.
>
> Custom header images, ( as an image tag ) are used by many of the core
> teams, including
>
> Twenty Eleven
> Twenty Fourteen
> Twenty sixteen
> Twenty Ten
> Twenty Twelve
> Twenty Seventeen
>
> It is also used in a number of themes on the repo, using these functions.
> [https://www.wpdirectory.net/search/01H45S14KC5GX7PFN1EP60A974
> the_custom_header_markup]
> [https://www.wpdirectory.net/search/01H45S48HHE1B10RYQQHVE8K0C
> get_custom_header_markup]
> [https://www.wpdirectory.net/search/01H45S7RPRRCXWPB3ASD0R5YFH
> get_header_image_tag]
> [https://www.wpdirectory.net/search/01H45S9FC4JX58YTPRS8RYTQCW
> get_header_image]
New description:
Added in #58235 ( [56037] ), fetch priority was added so add fetch
priority attribute to large images at the start of the page. However, the
custom header functionality built in WordPress support not support adding
this attribute.
Custom header images, ( as an image tag ) are used by many of the core
teams, including
Twenty Eleven
Twenty Fourteen
Twenty sixteen
Twenty Ten
Twenty Twelve
Twenty Seventeen
It is also used in a number of themes on the repo, using these functions.
[https://www.wpdirectory.net/search/01H45S14KC5GX7PFN1EP60A974
the_custom_header_markup]
[https://www.wpdirectory.net/search/01H45S48HHE1B10RYQQHVE8K0C
get_custom_header_markup]
[https://www.wpdirectory.net/search/01H45S7RPRRCXWPB3ASD0R5YFH
get_header_image_tag]
[https://www.wpdirectory.net/search/01H45S9FC4JX58YTPRS8RYTQCW
get_header_image]
[https://www.wpdirectory.net/search/01H45SG04J389C14F67M38TB5P
the_header_image]
--
Comment (by spacedmonkey):
For extra context, the following core themes, do you use either
the_custom_header_markup or the_header_image header functions. There are
hardcode the image tags in the template.
[https://github.com/WordPress/wordpress-
develop/blob/a1a31fc47348a6e6164df05f5dc37e307360f4a1/src/wp-
content/themes/twentyeleven/header.php#L123 Twenty Eleven]
[https://github.com/WordPress/wordpress-
develop/blob/a1a31fc47348a6e6164df05f5dc37e307360f4a1/src/wp-
content/themes/twentyfourteen/header.php#L39 Twenty Fourteen]
[https://github.com/WordPress/wordpress-
develop/blob/a1a31fc47348a6e6164df05f5dc37e307360f4a1/src/wp-
content/themes/twentysixteen/header.php#L105 Twenty sixteen]
[https://github.com/WordPress/wordpress-
develop/blob/a1a31fc47348a6e6164df05f5dc37e307360f4a1/src/wp-
content/themes/twentyten/header.php#L107 Twenty Ten]
[https://github.com/WordPress/wordpress-
develop/blob/a1a31fc47348a6e6164df05f5dc37e307360f4a1/src/wp-
content/themes/twentytwelve/header.php#L57 Twenty Twelve]
Retro fitting these themes might be possible. But some of these theme
support older version of WP, where the `the_header_image` function does
exist ( Add in WP 4.4 ).
I have already created a ticket for retro fitting Twenty sixteen at
#58675.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58680#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list