Opened 15 years ago
Closed 14 years ago
#9922 closed defect (bug) (fixed)
wp_crop_image() and image_resize() are inconsistent. Both should return WP_Error objects on error.
Reported by: | mdawaffe | Owned by: | westi |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Media | Keywords: | has-patch early |
Focuses: | Cc: |
Description
wp_crop_image() returns a string on error. resize_image() returns a WP_Error object.
Both use wp_load_image() and should have consistent return values.
Attached. Assigned to 2.9. 2.8?
I also think wp_load_image() should return a WP_Error object instead of a string on error, but maybe that's a separate ticket.
Attachments (1)
Change History (5)
#3
@
14 years ago
- Keywords early added
- Milestone changed from 2.9 to 3.0
- Owner set to westi
- Status changed from new to accepted
This sounds like a good idea to me.
I am wary of changing the return value of a function this close to release - would have rather done this pre-beta to make sure plugin authors had a chance to catch anywhere they are relying on current behaviour.
We should also change wp_load_image to return a WP_Error at the same time I agree.
Note: See
TracTickets for help on using
tickets.
+1