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

WordPress Trac noreply at wordpress.org
Thu Feb 21 16:55:42 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:  5.2
Component:  Media                                |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests 2nd-        |     Focuses:
  opinion                                        |  accessibility
-------------------------------------------------+-------------------------

Comment (by afercia):

 > deprecating that function is out of this ticket's scope

 I'm not fully sure it is actually. If this ticket introduces a new
 function with the specific purpose of providing a better way to get image
 metas, it also means the new function should be recommended especially
 when building the image markup.

 It also automatically implies the old function is not ideal, at least for
 the purpose of building the image markup, and I'd say also for the reasons
 mentioned by @ryanshoover.

 At the very least, the `wp_get_attachment_image_src` documentation should
 be updated to clearly state in uppercase, blinking, characters :) "do not
 use this function to build the image markup, use xyz instead."

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


More information about the wp-trac mailing list