Make WordPress Core

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's profile kadamwhite Owned by: drewapicture's profile 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.

Attachments (1)

media.diff (1.8 KB) - added by kadamwhite 9 years ago.
dockblock updates for wp-includes/media.php

Download all attachments as: .zip

Change History (4)

@kadamwhite
9 years ago

dockblock updates for wp-includes/media.php

#1 @SergeyBiryukov
9 years ago

  • Milestone changed from Awaiting Review to 4.4

#2 @SergeyBiryukov
9 years ago

  • Owner set to DrewAPicture
  • Status changed from new to assigned

#3 @wonderboymusic
9 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 34470:

Include fourth array parameter in return value doc block for wp_get_attachment_image_src().

Props kadamwhite.
Fixes #33905.

Note: See TracTickets for help on using tickets.