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

WordPress Trac noreply at wordpress.org
Wed Jun 8 03:30:55 UTC 2016


#17262: wp_get_attachment_thumb_file should check new 'thumbnail' image size
-------------------------------------------------+-------------------------
 Reporter:  lonnylot                             |       Owner:  joemcgill
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  4.6
Component:  Media                                |     Version:  3.0
 Severity:  normal                               |  Resolution:
 Keywords:  good-first-bug has-patch has-unit-   |     Focuses:
  tests close                                    |
-------------------------------------------------+-------------------------
Changes (by joemcgill):

 * keywords:  good-first-bug has-patch has-unit-tests => good-first-bug has-
     patch has-unit-tests close


Comment:

 After spending some more time thinking about this, I don't believe we
 should make the change suggested in this ticket at this point.

 My reasoning is that each time `wp_get_attachment_thumb_file()` is used in
 core, it's sole purpose is to fallback to the old-style `thumb` size
 whenever `thumbnail` is requested but not found (see `image_downsize()`
 and `wp_get_attachment_thumb_url()`).

 I do like the idea of deprecating `wp_get_attachment_thumb_url()` as
 @swissspidy suggests above. One option for deprecating
 `wp_get_attachment_thumb_file()` would be to add a new function like
 `wp_get_attachment_image_file()`, which would return the server file path
 of an image when passed an attachment's `$post_id` and `$size`. However, I
 can't think of a place where we would make use of such a function in Core
 other than where `wp_get_attachment_thumb_file()` is working just fine.

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


More information about the wp-trac mailing list