Created
June 30, 2013 08:57
-
-
Save paulund/5894433 to your computer and use it in GitHub Desktop.
Function to allow users to login into WordPress using your 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