wp_get_attachment_image_src() is misnamed
|Reported by:||rulatir||Owned by:|
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)
comment:2 c3mdigital — 20 months ago
- Type changed from defect (bug) to enhancement
- Version set to 2.5