* Return empty arrays instead of false for all conditions in get_blogs_of_user().

* When deleting a user, use a delete_metadata_by_mid() loop over the meta so that the meta cache is cleared.
* Use remove_user_from_blog() for DRYness.

Props nacin, duck_
Fixes #19500


git-svn-id: https://develop.svn.wordpress.org/trunk@20581 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2012-04-24 22:13:47 +00:00
parent f55dbdbd27
commit d3571040fb
3 changed files with 15 additions and 13 deletions
+4 -1
View File
@@ -160,7 +160,10 @@ function wpmu_delete_user( $id ) {
}
}
$wpdb->delete( $wpdb->users, array( 'ID' => $id ) );
$meta = $wpdb->get_col( $wpdb->prepare( "SELECT umeta_id FROM $wpdb->usermeta WHERE user_id = %d", $id ) );
foreach ( $meta as $mid )
delete_metadata_by_mid( 'user', $mid );
$wpdb->delete( $wpdb->usermeta, array( 'user_id' => $id ) );
clean_user_cache( $user );