shshanker
1/17/2017 - 4:08 AM

Plugin Name: (#90328) Login with E-Mail address

Plugin Name: (#90328) Login with E-Mail address

<?php
/** Plugin Name: (#90328) Login with E-Mail address */
function login_with_email_address( &$username ) {
    $user = get_user_by( 'email', $username );
    if ( !empty( $user->user_login ) )
        $username = $user->user_login;
    return $username;
}
add_action( 'wp_authenticate','login_with_email_address' );