Update 2017-04-03: This feature is included in core with WordPress versions 4.5 or later.
Here is a quick snippet to allow users on your site to sign in via their e-mail as well as their password.
Save it as a file in your plugins/ folder and activate it normally as a plugin.
<?php
/*
Plugin Name: Login with E-mail
Plugin URI: https://snippets.khromov.se/user-login-via-e-mail-in-wordpress/
Description: Lets users log in via their E-mail as well as their username
Version: 2014.07.03
Author: khromov
Author URI: https://snippets.khromov.se
License: GPL2
*/
add_filter('authenticate', function($user, $username, $password)
{
if (is_email($username))
{
$user = get_user_by('email', $username);
if($user)
$username = $user->user_login;
}
return wp_authenticate_username_password(null, $username, $password);
}, 20, 3);