[wp-trac] [WordPress Trac] #46113: Incongruent returned value for wp_get_attachment_image_src
WordPress Trac
noreply at wordpress.org
Sat Jan 26 21:45:09 UTC 2019
#46113: Incongruent returned value for wp_get_attachment_image_src
--------------------------+-----------------------------
Reporter: wido | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 2.5
Severity: normal | Keywords: needs-patch
Focuses: |
--------------------------+-----------------------------
As per docblock the function `wp_get_attachment_image_src` will return
{{{false|array Returns an array (url, width, height, is_intermediate), or
false, if no image is available.}}}
Function `wp_get_attachment_image_src` return an indexed array containing
source, width and height, but not the intermediated value in case the
internal call to `image_downsize` return false.
It's this latter that will return the array containing all of the
elements, therefore if it's false `wp_get_attachment_image_src` will try
to create them but will miss `is_intermediated` value.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46113>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list