WordPress.org

Make WordPress Core

Changeset 46971


Ignore:
Timestamp:
12/17/2019 03:34:49 PM (9 months ago)
Author:
SergeyBiryukov
Message:

Login/Registration: Pass the error data to the wp_login_failed action.

Props hamedmoodi, rixeo.
Fixes #49007.

File:
1 edited

Legend:

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

    r46878 r46971  
    548548
    549549        if ( is_wp_error( $user ) && ! in_array( $user->get_error_code(), $ignore_codes ) ) {
     550            $error = $user;
     551
    550552            /**
    551553             * Fires after a user login has failed.
     
    553555             * @since 2.5.0
    554556             * @since 4.5.0 The value of `$username` can now be an email address.
    555              *
    556              * @param string $username Username or email address.
     557             * @since 5.4.0 The `$error` parameter was added.
     558             *
     559             * @param string   $username Username or email address.
     560             * @param WP_Error $error    A WP_Error object with the authentication failure details.
    557561             */
    558             do_action( 'wp_login_failed', $username );
     562            do_action( 'wp_login_failed', $username, $error );
    559563        }
    560564
Note: See TracChangeset for help on using the changeset viewer.