[wp-trac] [WordPress Trac] #54192: `get_header_image_tag` doesn't add `srcset`/`sizes`
WordPress Trac
noreply at wordpress.org
Mon Sep 27 20:01:06 UTC 2021
#54192: `get_header_image_tag` doesn't add `srcset`/`sizes`
--------------------------+------------------------------
Reporter: strarsis | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by strarsis):
Replying to [comment:1 joyously]:
> The `srcset` and `sizes` are added later, for all the images that have a
`wp-image-*` class. The image id is needed to do the lookup for the data
to use.
How are these attributes added later? Does WordPress parse the HTML and
add these directly?
The function uses a filter, but it doesn't seem to be used elsewhere as
the secret and sizes attributes are missing.
https://github.com/WordPress/WordPress/blob/07139653b9f1b8b1cc88195b971e96597fbc8b10
/wp-includes/theme.php#L1200
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54192#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list