[wp-trac] [WordPress Trac] #34477: Pass the named image size to the filter in `wp_get_attachment_image_sizes()`

WordPress Trac noreply at wordpress.org
Sat Oct 31 02:53:46 UTC 2015


#34477: Pass the named image size to the filter in
`wp_get_attachment_image_sizes()`
--------------------------+-----------------------
 Reporter:  joemcgill     |       Owner:  azaozz
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  4.4
Component:  Media         |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------

Comment (by azaozz):

 In 34477.1.patch:
 - Add another optional arg `$size_name` to
 `wp_get_attachment_image_sizes()`.
 - Pass it in core when available.

 This adds two more `preg_match()` to the display filter function. The
 matching is done only on the image tags, which is quite fast as the
 strings are short. Still `wp_image_add_srcset_and_sizes()` is a bit slower
 than before.

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


More information about the wp-trac mailing list