[wp-trac] [WordPress Trac] #21538: wp_get_attachment_image_src() is misnamed

WordPress Trac wp-trac at lists.automattic.com
Fri Aug 10 11:58:21 UTC 2012


#21538: wp_get_attachment_image_src() is misnamed
--------------------------+-----------------------------
 Reporter:  rulatir       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 The function wp_get_attachment_image_src is misnamed. The name suggests
 that the function returns the URL for the src attribute of img tag, and
 this suggestion is so strong that it is practically impossible to remember
 that it in fact returns an array. I've just now been bitten by this for
 perhaps 50th time, and I have lost what amounts to days of debugging on
 finding out again and again that a function named ...get...src doesn't get
 src.

 I suggest renaming to wp_get_attachment_image_attributes and
 forwarding+deprecating the old function.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21538>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list