Forked from rsharrer/Login with username or email address.php
Last active
August 29, 2015 14:09
-
-
Save fritids/8de7a5179680972ef1fa to your computer and use it in GitHub Desktop.
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