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

WordPress Trac noreply at wordpress.org
Sun Dec 9 20:06:17 UTC 2018


#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:  needs-patch  |     Focuses:  accessibility
-------------------------+-----------------------------

Comment (by ryanshoover):

 I've just added a patch that adds a new function
 `wp_get_attachment_image_attr( $attachment_id, $attribute )`. The function
 will return all the significant attribute values that get added to
 attachment image tags. This should be a nice catch-all for getting the alt
 text and any other values that a user would want to add to an image tag.

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


More information about the wp-trac mailing list