Opened 10 months ago

Last modified 9 months ago

#21538 new enhancement

wp_get_attachment_image_src() is misnamed

Reported by: rulatir Owned by:
Priority: normal Milestone: Awaiting Review
Component: Media Version: 2.5
Severity: normal Keywords:
Cc:

Description

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.

Change History (2)

  • Component changed from General to Media
  • Type changed from defect (bug) to enhancement
  • Version set to 2.5
Note: See TracTickets for help on using tickets.