Opened 4 years ago
Last modified 12 months ago
#38942 new enhancement
New filter for header image tag attributes
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | Themes | Keywords: | has-patch |
Focuses: | template | Cc: |
Description
There is currently no way to filter the attributes of the header image tag before it is used to build the header image tag HTML in the get_header_image_tag() function.
I've attached a diff to solve this problem by adding a new 'get_header_image_tag_attributes' filter.
Attachments (1)
Change History (9)
This ticket was mentioned in Slack in #core by junaidbhura. View the logs.
4 years ago
This ticket was mentioned in Slack in #core-themes by junaidbhura. View the logs.
4 years ago
#5
in reply to:
↑ 4
@
4 years ago
Replying to obenland:
I'm not sure a filter is really needed here since the function accepts an array of attributes that override any defaults. Am I missing something?
The idea is to have this work similar to wp_get_attachment_image_attributes
. There is currently no way to modify the header image's attributes like a normal attachment image.
There is a get_header_image_tag
filter, but that is applied after the image's HTML has already been built.
I'm not sure a filter is really needed here since the function accepts an array of attributes that override any defaults. Am I missing something?