[wp-trac] [WordPress Trac] #38942: New filter for header image tag attributes

WordPress Trac noreply at wordpress.org
Tue Nov 2 17:20:49 UTC 2021


#38942: New filter for header image tag attributes
---------------------------------------------+-----------------------------
 Reporter:  junaidbhura                      |       Owner:
                                             |  johnjamesjacoby
     Type:  enhancement                      |      Status:  closed
 Priority:  normal                           |   Milestone:  5.9
Component:  Themes                           |     Version:  4.7
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch commit needs-dev-note  |     Focuses:  template
---------------------------------------------+-----------------------------
Changes (by johnjamesjacoby):

 * owner:  (none) => johnjamesjacoby
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"51978" 51978]:
 {{{
 #!CommitTicketReference repository="" revision="51978"
 Themes: Introduce `get_header_image_tag_attributes` hook.

 This change adds a filter inside of the `get_header_image_tag()` function
 allowing developers to filter the attributes of the header image HTML tag
 before they are escaped, concatenated, and returned.

 Before this change, it was not possible to externally and preemptively
 intercept this array of attributes. After this change, these attributes
 can now be easily filtered, matching it nicely to the
 `wp_get_attachment_image_attributes` hook.

 Props audrasjb, chaion07, junaidbhura, sabernhardt.

 Fixes #38942.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/38942#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list