Don't die.

git-svn-id: https://develop.svn.wordpress.org/trunk@3315 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2005-12-15 22:26:22 +00:00
parent 03828f24dd
commit dcaa152386
1 changed files with 7 additions and 2 deletions

View File

@ -136,8 +136,13 @@ case 'delete':
if ( !current_user_can('edit_post', $post_id) )
die( __('You are not allowed to delete this post.') );
if ( (($post->post_status != 'attachment') && !wp_delete_post($post_id)) || !wp_delete_attachment($post_id))
die( __('Error in deleting...') );
if ( $post->post_status == 'attachment' ) {
if ( ! wp_delete_attachment($post_id) )
die( __('Error in deleting...') );
} else {
if ( !wp_delete_post($post_id) )
die( __('Error in deleting...') );
}
$sendback = $_SERVER['HTTP_REFERER'];
if (strstr($sendback, 'post.php')) $sendback = get_settings('siteurl') .'/wp-admin/post.php';