[wp-trac] [WordPress Trac] #51780: Add ability to easily get path to sized images (such as parameter to get_attached_file() or wp_get_attachment_thumb_file())

WordPress Trac noreply at wordpress.org
Tue Feb 28 23:35:20 UTC 2023


#51780: Add ability to easily get path to sized images (such as parameter to
get_attached_file() or wp_get_attachment_thumb_file())
-------------------------------------------------+-------------------------
 Reporter:  paulschreiber                        |       Owner:  joedolson
     Type:  enhancement                          |      Status:  reopened
 Priority:  normal                               |   Milestone:  6.2
Component:  Media                                |     Version:  5.5.3
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests 2nd-        |     Focuses:
  opinion changes-requested                      |
-------------------------------------------------+-------------------------

Comment (by azaozz):

 Replying to [comment:27 paulschreiber]:

 > Much of this was required because WPCOM behaves differently than
 everywhere else

 Yes, the media on WP.com is handled in a quite different way. For example,
 afaik, there is no `sizes` array in the image meta, and image sub-sizes
 are created "on the fly" when needed and then cached for some time. If a
 convenience function for WP.com is needed, perhaps a better option would
 be to request it there.

 Looking at the example use, it is for outputting a thumbnail image as data
 URL. Not sure if this is a common case to the extend that it would need a
 separate "convenience function", i.e. how many plugins would need that.
 But lets try to figure this out in 6.3.

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


More information about the wp-trac mailing list