[wp-trac] [WordPress Trac] #57086: Omit or filter decoding attribute in wp_get_attachment_image()

WordPress Trac noreply at wordpress.org
Tue Jan 31 19:40:06 UTC 2023


#57086: Omit or filter decoding attribute in wp_get_attachment_image()
---------------------------------------------+--------------------------
 Reporter:  maximej                          |       Owner:  flixos90
     Type:  enhancement                      |      Status:  closed
 Priority:  normal                           |   Milestone:  6.2
Component:  Media                            |     Version:  6.1
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit  |     Focuses:  performance
---------------------------------------------+--------------------------
Changes (by flixos90):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"55171" 55171]:
 {{{
 #!CommitTicketReference repository="" revision="55171"
 Media: Allow to omit `decoding="async"` on tags from
 `wp_get_attachment_image()`.

 When adding `decoding="async"` to images was introduced in [53480], it did
 not provide the ability to customize that behavior specifically for image
 tags returned from `wp_get_attachment_image()`.

 With this changeset it is now possible to explicitly provide a `decoding`
 value of e.g. boolean `false` in the `$attr` parameter of the function, to
 ensure the attribute is omitted.

 Props maximej, adamsilverstein, flixos90, costdev, peterwilsoncc,
 mukesh27.
 Fixes #57086.
 }}}

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


More information about the wp-trac mailing list