[wp-trac] [WordPress Trac] #17262: wp_get_attachment_thumb_file should check new 'thumbnail' image size

WordPress Trac noreply at wordpress.org
Mon Jun 13 20:07:23 UTC 2022


#17262: wp_get_attachment_thumb_file should check new 'thumbnail' image size
-------------------------+-----------------------------
 Reporter:  lonnylot     |       Owner:  SergeyBiryukov
     Type:  enhancement  |      Status:  reviewing
 Priority:  normal       |   Milestone:  Future Release
Component:  Media        |     Version:  3.0
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |     Focuses:
-------------------------+-----------------------------
Changes (by azaozz):

 * keywords:  good-first-bug has-patch => needs-patch


Comment:

 Looking at the history of this ticket (all 11 years of it!), thinking
 @nacin's comment from [2013
 https://core.trac.wordpress.org/ticket/17262#comment:9] and @joemcgill's
 comment from [2016
 https://core.trac.wordpress.org/ticket/17262#comment:28] still make sense.
 In short:

 1. Deprecate `wp_get_attachment_thumb_file()`.
 2. Make `wp_get_attachment_thumb_url()` a direct alias of
 `wp_get_attachment_image_url()`.
 3. (TBD) Perhaps add some code to look for `$image_meta['thumb']` when
 `$image_meta['sizes']` is not set (only when not set, can be empty for
 other reasons).

 The consideration for the TBD is whether it's worth it to still support
 this format of the image meta. As far as I know it has existed only for a
 short time about 15 years ago. Probably worth it but needs some "track
 archeology" to confirm :)

 Not sure it is a good idea to add a new function to specifically get the
 path to an image's thumbnail. Don't see the need for it (see mentioned
 comments).

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


More information about the wp-trac mailing list