In functions.php
// Inloggen met email adres mogelijk maken
add_filter( 'authenticate', 'wbmz_authenticate_username_password', 20, 3 );
function wbmz_authenticate_username_password( $user, $username, $password ) {
// If an email address is entered in the username box,
// then look up the matching username and authenticate as per normal, using that.
if ( ! empty( $username ) )
$user = get_user_by( 'email', $username );
if ( isset( $user->user_login, $user ) )
$username = $user->user_login;
// using the username found when looking up via email
return wp_authenticate_username_password( NULL, $username, $password );
}
#login #woocommerce #wordpress