Last active
August 29, 2015 14:24
-
-
Save lmm214/2633d583b052fadba023 to your computer and use it in GitHub Desktop.
//允许 Email 登录 WordPress 后台
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
//允许 Email 登录 WordPress 后台 | |
function allow_email_login($username ) { | |
$user = get_user_by( 'email', $username ); | |
if ( ! empty( $user) ) { | |
$username = $user->user_login; | |
} | |
return $username; | |
} | |
add_filter('sanitize_user', 'allow_email_login'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment