WordPress.org

Make WordPress Core

Changeset 49945


Ignore:
Timestamp:
01/07/2021 05:24:32 PM (8 months ago)
Author:
johnbillion
Message:

Login and Registration: Introduce the lostpassword_user_data filter which allows for the user data object during a password reset request to be filtered.

Props marcelo2605

Fixes #51924

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-login.php

    r49758 r49945  
    369369        $user_data = get_user_by( 'login', $login );
    370370    }
     371
     372    /**
     373     * Filters the user data during a password reset request.
     374     *
     375     * Allows, for example, custom validation using data other than username or email address.
     376     *
     377     * @since 5.7.0
     378     *
     379     * @param WP_User|false $user_data WP_User object if found, false if the user does not exist.
     380     * @param WP_Error      $errors    A WP_Error object containing any errors generated
     381     *                                 by using invalid credentials.
     382     */
     383    $user_data = apply_filters( 'lostpassword_user_data', $user_data, $errors );
    371384
    372385    /**
Note: See TracChangeset for help on using the changeset viewer.