Make WordPress Core

Ticket #30789: 30789.diff

File 30789.diff, 952 bytes (added by MikeHansenMe, 10 years ago)

Add just the error instead of the whole object and minor code cleanup

  • src/wp-includes/pluggable.php

     
    561561                $user = new WP_Error('authentication_failed', __('<strong>ERROR</strong>: Invalid username or incorrect password.'));
    562562        }
    563563
    564         $ignore_codes = array('empty_username', 'empty_password');
     564        $ignore_codes = array( 'empty_username', 'empty_password' );
    565565
    566         if (is_wp_error($user) && !in_array($user->get_error_code(), $ignore_codes) ) {
     566        if ( is_wp_error( $user ) && ! in_array( $user->get_error_code(), $ignore_codes ) ) {
    567567                /**
    568568                 * Fires after a user login has failed.
    569569                 *
    570570                 * @since 2.5.0
    571571                 *
    572572                 * @param string $username User login.
     573                 * @param string Login error.
    573574                 */
    574                 do_action( 'wp_login_failed', $username );
     575                do_action( 'wp_login_failed', $username, $user->get_error_code() );
    575576        }
    576577
    577578        return $user;