Opened 9 years ago
Closed 9 years ago
#33905 closed defect (bug) (fixed)
Include fourth array parameter in return value doc block for wp_get_attachment_image_src
Reported by: | kadamwhite | Owned by: | DrewAPicture |
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 4.4 |
Component: | Media | Keywords: | has-patch |
Focuses: | Cc: |
Description
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.
dockblock updates for wp-includes/media.php