Created
April 10, 2014 15:25
-
-
Save ovizii/10393832 to your computer and use it in GitHub Desktop.
Login with email
This file contains hidden or 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
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'); | |
function change_username_wps_text($text){ | |
if(in_array($GLOBALS['pagenow'], array('wp-login.php'))){ | |
if ($text == 'Username'){$text = 'Username / Email';} | |
} | |
return $text; | |
} | |
add_filter( 'gettext', 'change_username_wps_text' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment