Make WordPress Core

Opened 11 years ago

Closed 11 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
Priority: normal Milestone: 4.4
Component: Media Version: 4.4
Severity: normal Keywords: has-patch
Cc: Focuses:

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 11 years ago.
dockblock updates for wp-includes/media.php

Download all attachments as: .zip

Change History (4)

@kadamwhite
11 years ago

dockblock updates for wp-includes/media.php

#1 @SergeyBiryukov
11 years ago

  • Milestone Awaiting Review → 4.4

#2 @SergeyBiryukov
11 years ago

  • Owner set to DrewAPicture
  • Status new → assigned

#3 @wonderboymusic
11 years ago

  • Resolution → fixed
  • Status assigned → 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.