Make WordPress Core


Ignore:
Timestamp:
07/05/2020 11:19:35 AM (4 years ago)
Author:
ocean90
Message:

Multisite: Delete the signup entry when a user is deleted from the database.

When a user has registered with incorrect data and got the account deleted immediately, it currently wasn't possible to register with the same login or email address again due to the existing signup entry. They had to wait for two days until the entry gets automatically deleted. Now the associated signup entry gets deleted as part of the account deletion.

Fixes #43232.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-functions.php

    r48121 r48315  
    12751275        'meta'     => $meta,
    12761276    );
     1277}
     1278
     1279/**
     1280 * Deletes am associated signup entry when a user is deleted from the database.
     1281 *
     1282 * @since 5.5.0
     1283 *
     1284 * @param int      $id       ID of the user to delete.
     1285 * @param int|null $reassign ID of the user to reassign posts and links to.
     1286 * @param WP_User  $user     User object.
     1287 */
     1288function wp_delete_signup_on_user_delete( $id, $reassign, $user ) {
     1289    global $wpdb;
     1290
     1291    $wpdb->delete( $wpdb->signups, array( 'user_login' => $user->user_login ) );
    12771292}
    12781293
Note: See TracChangeset for help on using the changeset viewer.