Post delete fix from David House. fixes #2173

git-svn-id: http://svn.automattic.com/wordpress/trunk@3379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-12-29 21:16:53 +00:00
parent 6d40d77615
commit 8cdc22e3d8
1 changed files with 4 additions and 3 deletions

View File

@ -30,12 +30,13 @@ case 'delete-link' :
case 'delete-post' :
case 'delete-page' :
$id = (int) $_POST['id'];
if ( !current_user_can('edit_post', $post_id) )
if ( !current_user_can('edit_post', $id) ) {
die('-1');
}
if ( wp_delete_post($id) )
if ( wp_delete_post($id) ) {
die('1');
else die('0');
} else die('0');
break;
case 'delete-cat' :
if ( !current_user_can('manage_categories') )