[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
Fri Feb 24 00:56:40 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-opinion  |     Focuses:
--------------------------------------------------+------------------------

Comment (by joedolson):

 The logic, to me, is that images are the only file type that has managed
 variants, and it makes sense to use the same function to fetch variants of
 a file as you would use to fetch the attachment. The function is to get a
 file, not to get an attachment, so it makes sense that you could use it to
 fetch any file managed in the media library.

 I could imagine it being extended to fetch alternate versions of
 audio/video files, too (e.g., different formats or different resolutions),
 though that isn't currently something managed by the library.

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


More information about the wp-trac mailing list