Don't delete everything if there are no posts.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-04-28 20:36:31 +00:00
parent cf06e8e7f6
commit b93876eb46
1 changed files with 16 additions and 15 deletions

View File

@ -138,6 +138,7 @@ case 'delete':
die(__('Can’t delete a user whose level is higher than yours.'));
$post_ids = $wpdb->get_col("SELECT ID FROM $tableposts WHERE post_author = $id");
if ($post_ids) {
$post_ids = implode(',', $post_ids);
// Delete comments, *backs
@ -152,7 +153,7 @@ case 'delete':
$wpdb->query("DELETE FROM $tableposts WHERE post_author = $id");
// FINALLY, delete user
$wpdb->query("DELETE FROM $tableusers WHERE ID = $id");
}
header('Location: users.php?deleted=true');
break;