[wp-trac] [WordPress Trac] #33905: Include fourth array parameter in return value doc block for wp_get_attachment_image_src

WordPress Trac noreply at wordpress.org
Wed Sep 16 21:05:40 UTC 2015


#33905: Include fourth array parameter in return value doc block for
wp_get_attachment_image_src
--------------------------+-----------------------------
 Reporter:  kadamwhite    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Media         |    Version:  trunk
 Severity:  normal        |   Keywords:  has-patch
  Focuses:                |
--------------------------+-----------------------------
 While implementing responsive image markup in a theme we became confused
 that `wp_get_attachment_image_src` would return the full-sized image if
 the file for the provided intermediate $size had not yet been generated;
 it did not appear to be possible to validate whether the returned image
 was an intermediate size without inspecting the URL.

 Diving into the code revealed that `image_downsize`, whose results are
 passed through to the output of `wp_get_attachment_image_src`, returns a
 four-element array. The fourth array property was exactly what we needed
 to render the proper markup, it just wasn't documented.

 This patch updates the doc blocks for these methods to report all of the
 properties of their array return values.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33905>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list