git-svn-id: http://svn.automattic.com/wordpress/trunk@3350 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-12-23 23:10:59 +00:00
parent 0ea2312357
commit a8652d0823
1 changed files with 2 additions and 10 deletions

View File

@ -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