Don't die.
git-svn-id: http://svn.automattic.com/wordpress/trunk@3315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ee7b572202
commit
32743aec23
|
@ -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';
|
||||
|
|
Loading…
Reference in New Issue