functions.php
1 2 3 4 5 6 7 8 9 10 |
function email_login( $user, $username, $password ) { $user = get_user_by('email',$username); if(!empty($user->user_login)) { $username = $user->user_login; } else { $username = ''; } return wp_authenticate_username_password( null, $username, $password ); } add_filter('authenticate', 'email_login', 20, 3); |
コメント