Forked from paulund/login-to-wordpress-with-email-address.php
Created
July 15, 2013 13:12
-
-
Save brycejacobson/5999826 to your computer and use it in GitHub Desktop.
Login to WordPress with email address.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
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'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment