mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
* 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:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user