Opened 17 years ago
Closed 15 years ago
#5166 closed defect (bug) (invalid)
use wp_die instead of echo/exit pair
Reported by: | nbachiyski | Owned by: | westi |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | minor | Version: | 2.3 |
Component: | General | Keywords: | has-patch |
Focuses: | Cc: |
Description
In tow places in wp-admin
errors are taken from WP_Error
object and are just printed and the script ends.
Thus it is both not very beautoful and doesn't issue the correct encoding headers. Using wp_die
solves both problems.
Attachments (1)
Change History (7)
#3
in reply to:
↑ 2
@
17 years ago
Replying to ryan:
Maybe add a WP_Error::die_with_message() method?
Cute
It might be nice if we can come up with something nice to replace the following:
if ( is_wp_error($result) ) { wp_die( $result->get_error_message() ); }
It would nice if all occurrances of the above could become oneliners like:
wp_die_if_wp_error($result);
Note: See
TracTickets for help on using
tickets.
+1 to the first change
Can we change admin-ajax.php like that as we a returning the error to js not the browser?