From a8652d082397fb375c5061fccd8a12b500d6e90c Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 23 Dec 2005 23:10:59 +0000 Subject: [PATCH] Use API. git-svn-id: http://svn.automattic.com/wordpress/trunk@3350 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-db.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/wp-admin/admin-db.php b/wp-admin/admin-db.php index 20d4cc164..bf8692ab3 100644 --- a/wp-admin/admin-db.php +++ b/wp-admin/admin-db.php @@ -216,16 +216,8 @@ function wp_delete_user($id, $reassign = 'novalue') { $post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_author = $id"); if ($post_ids) { - $post_ids = implode(',', $post_ids); - - // Delete comments, *backs - $wpdb->query("DELETE FROM $wpdb->comments WHERE comment_post_ID IN ($post_ids)"); - // Clean cats - $wpdb->query("DELETE FROM $wpdb->post2cat WHERE post_id IN ($post_ids)"); - // Clean post_meta - $wpdb->query("DELETE FROM $wpdb->postmeta WHERE post_id IN ($post_ids)"); - // Delete posts - $wpdb->query("DELETE FROM $wpdb->posts WHERE post_author = $id"); + foreach ($post_ids as $post_id) + wp_delete_post($post_id); } // Clean links