[wp-trac] [WordPress Trac] #34817: Add a new image size detection function

WordPress Trac noreply at wordpress.org
Mon Nov 30 03:35:08 UTC 2015


#34817: Add a new image size detection function
------------------------------+------------------------------
 Reporter:  simonrcodrington  |       Owner:
     Type:  enhancement       |      Status:  new
 Priority:  normal            |   Milestone:  Awaiting Review
Component:  Media             |     Version:  4.3.1
 Severity:  normal            |  Resolution:
 Keywords:                    |     Focuses:
------------------------------+------------------------------

Comment (by joemcgill):

 Hi @simonrcodrington,

 I believe `image_get_intermediate_size()` might already provide what
 you're suggesting. If you pass in an attachment ID and size name that
 doesn't exist, the function will return false.

 Alternately, this sounds similar to the issue addressed in #33905. In that
 case, the solution was to check for a (previously undocumented) fourth
 parameter on the array returned from `wp_get_attachment_image_src` to make
 sure the image being returned was an intermediate size instead of the
 fallback 'full' size.

 Would either of these options work for your use case?

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


More information about the wp-trac mailing list