[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:36:23 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 joedolson):

 I can see some issues with the eventual removal of
 `wp_get_attachment_image_src`, since it's a very commonly used function,
 but that shouldn't stop  us from deprecating it and discouraging its use.

 I also agree that deprecating that function is out of this ticket's scope,
 and should be a separate ticket.

 I don't see it as very likely that expanding that function's return value
 would break code - it seems like just iterating blindly over the values
 wouldn't work, since the values are numerically keyed - they'd have to
 call specific key values. Regardless, I'd still prefer deprecation.

 In an ideal world, I'd want to remove the extra attributes from
 `wp_get_attachment_image_src` and only return src, but that's definitely
 not an option!

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


More information about the wp-trac mailing list