WordPress.org

Make WordPress Core

Ticket #30789: 30789.2.diff

File 30789.2.diff, 1.0 KB (added by MikeHansenMe, 4 years ago)

Refresh

  • src/wp-includes/pluggable.php

     
    534534                $user = new WP_Error( 'authentication_failed', __( '<strong>ERROR</strong>: Invalid username, email address or incorrect password.' ) );
    535535        }
    536536
    537         $ignore_codes = array('empty_username', 'empty_password');
     537        $ignore_codes = array( 'empty_username', 'empty_password' );
    538538
    539         if (is_wp_error($user) && !in_array($user->get_error_code(), $ignore_codes) ) {
     539        if ( is_wp_error( $user ) && ! in_array( $user->get_error_code(), $ignore_codes ) ) {
    540540                /**
    541541                 * Fires after a user login has failed.
    542542                 *
     
    544544                 * @since 4.5.0 The value of `$username` can now be an email address.
    545545                 *
    546546                 * @param string $username Username or email address.
     547                 * @param strin  Login error.
    547548                 */
    548                 do_action( 'wp_login_failed', $username );
     549                do_action( 'wp_login_failed', $username, $user->get_error_code() );
    549550        }
    550551
    551552        return $user;