User deletion fixes. Props yoavf. fixes #13242
git-svn-id: http://svn.automattic.com/wordpress/trunk@14422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -451,6 +451,8 @@ function wp_delete_user( $id, $reassign = 'novalue' ) {
|
||||
$wpdb->update( $wpdb->links, array('link_owner' => $reassign), array('link_owner' => $id) );
|
||||
}
|
||||
|
||||
clean_user_cache($id);
|
||||
|
||||
// FINALLY, delete user
|
||||
if ( !is_multisite() ) {
|
||||
$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d", $id) );
|
||||
@@ -460,8 +462,6 @@ function wp_delete_user( $id, $reassign = 'novalue' ) {
|
||||
$wpdb->query("DELETE FROM $wpdb->usermeta WHERE user_id = $id AND meta_key = '{$level_key}'");
|
||||
}
|
||||
|
||||
clean_user_cache($id);
|
||||
|
||||
// allow for commit transaction
|
||||
do_action('deleted_user', $id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user