BTW, using email address as username is easy. Just put this in your functions.php:
/** Beau Lebens Email Login plugin
* Allow the use of an email address for login. This just looks up the
* matching username for an email address, and then continues like normal.
* Parameters are references, so we just update in place.
* @param String $user The username they entered (in this case email)
* @param String $pass The password they entered
**/
function dr_email_login($user, $pass) {
global $wpdb;
if (is_email($user)) {
$found = $wpdb->get_var($wpdb->prepare("SELECT user_login FROM $wpdb->users WHERE user_email = '%s'", $user));
$user = $found ? $found : $user;
}
return;
}
add_action('wp_authenticate', 'dr_email_login', false, 2);
With this function you can use both username or email address to log in, it makes no difference.
So why is this not a standard Wordpress feature by now? I really don't get it.
The stupid username is sacred in the Wordpress world. There is no way to get rid of it entirely. Even if you want to use only email as login, you need to figure out a way to autogenerate and hide a username for the system to work.