It seems to be more and more common to see sites that allow users to log in with their username or email address.
Here’s how to add that ability to WordPress
//remove_filter('authenticate', 'wp_authenticate_username_password', 20, 3); add_filter('authenticate', 'wp_authenticate_username_password_redux', 20, 3); function wp_authenticate_username_password_redux( $user, $username, $password ) { if ( is_email( $username ) ) { $user_obj = get_user_by_email( $username ); if ( $user_obj ) $username = $user_obj->user_login; } return wp_authenticate_username_password( $user, $username, $password ); }
* works with or without the remove_filter
line.