WordPress.org

Make WordPress Core

Ticket #38334: 38334.2.diff

File 38334.2.diff, 1.3 KB (added by wpgurudev, 2 years ago)

Patch with updated docblock. Also handled variable initialisation.

  • src/wp-login.php

    diff --git a/src/wp-login.php b/src/wp-login.php
    index ace097d9c0..833a8f547c 100644
    a b function wp_login_viewport_meta() { 
    363363 * @return bool|WP_Error True: when finish. WP_Error on error
    364364 */
    365365function retrieve_password() {
    366         $errors = new WP_Error();
     366        $errors    = new WP_Error();
     367        $user_data = false;
    367368
    368369        if ( empty( $_POST['user_login'] ) || ! is_string( $_POST['user_login'] ) ) {
    369370                $errors->add( 'empty_username', __( '<strong>ERROR</strong>: Enter a username or email address.' ) );
    function retrieve_password() { 
    380381        /**
    381382         * Fires before errors are returned from a password reset request.
    382383         *
     384         * @param WP_Error      $errors    A WP_Error object containing any errors generated
     385         *                                 by using invalid credentials.
     386         *
     387         * @param WP_User|false $user_data false if user not found else WP_User object.
     388         *
    383389         * @since 2.1.0
    384390         * @since 4.4.0 Added the `$errors` parameter.
    385          *
    386          * @param WP_Error $errors A WP_Error object containing any errors generated
    387          *                         by using invalid credentials.
    388391         */
    389         do_action( 'lostpassword_post', $errors );
     392        do_action( 'lostpassword_post', $errors, $user_data );
    390393
    391394        if ( $errors->has_errors() ) {
    392395                return $errors;