Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save paulund/5894433 to your computer and use it in GitHub Desktop.
Save paulund/5894433 to your computer and use it in GitHub Desktop.
Function to allow users to login into WordPress using your email address.
<?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