Opened 12 years ago
Closed 11 years ago
#21538 closed enhancement (duplicate)
wp_get_attachment_image_src() is misnamed
Reported by: | rulatir | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.5 |
Component: | Media | Keywords: | |
Focuses: | 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 (3)
Note: See
TracTickets for help on using
tickets.
Duplicate of #12238.
Deprecating such a popular function isn't a good idea, and instead of renaming we should create a new function.