Site icon Hip-Hop Website Design and Development

How to login with email only no username?

After searching for a couple of days and reading 2 year old threads I’m having difficulty finding a solution to the problem of having users login by email only.

At first I was delighted to see WP_Email_Login only to find out you can still use your username to login. I’m not sure how to go about writing this as a plugin. My idea is to override the register_new_user function. I didn’t see this on the “pluggable” functions list. Can I use filters/action do accomplish this?

I realize it’s not fashionable to edit the core files so I’m hoping a solution is out there however if one does not exist I’ll take my chances. In the first line of the “register_new_user” function in wp-login.php I can add:

$nickname_variable(??) = $user_login // set the nickname to the username
$user_login = $user_email; // set the user_login/username to the email address

This works quite nicely since WordPress doesn’t allow people to change their username. In the Register Screen (form) it asks for the Username & Email; I’d like to set the Username to the Nickname variable (if someone can tell me what the nickname variable is called or where it’s set during registration that’d be appreciated).

Cheers,

Smith