[wp-trac] [WordPress Trac] #30180: wp_get_attachment_image_src does not return alt or meta

WordPress Trac noreply at wordpress.org
Sat Jan 19 09:15:57 UTC 2019


#30180: wp_get_attachment_image_src does not return alt or meta
--------------------------------------+-----------------------------
 Reporter:  joedolson                 |       Owner:  joedolson
     Type:  enhancement               |      Status:  accepted
 Priority:  normal                    |   Milestone:  Future Release
Component:  Media                     |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  accessibility
--------------------------------------+-----------------------------

Comment (by afercia):

 On the other hand, the function already returns "meta" information by
 default:

 `@return false|array Returns an array (url, width, height,
 is_intermediate), or false, if no image is available.`

 {{{
  * The returned array contains four values: the URL of the attachment
 image src,
  * the width of the image file, the height of the image file, and a
 boolean
  * representing whether the returned array describes an intermediate
 (generated)
  * image size or the original, full-sized upload.
 }}}

 I'd agree the function name isn't ideal but I don't see any harm in adding
 the `alt` value to the returned array.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/30180#comment:31>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list