woocommerce_get_username_from_email filter for login Closes #4791

This commit is contained in:
Mike Jolley 2014-02-14 11:47:12 +00:00 committed by Coen Jacobs
parent 5c22b36cb7
commit 5564e49b15
1 changed files with 1 additions and 1 deletions

View File

@ -726,7 +726,7 @@ class WC_Form_Handler {
throw new Exception( '<strong>' . __( 'Error', 'woocommerce' ) . ':</strong> ' . __( 'Password is required.', 'woocommerce' ) );
}
if ( is_email( $_POST['username'] ) ) {
if ( is_email( $_POST['username'] ) && apply_filters( 'woocommerce_get_username_from_email', true ) ) {
$user = get_user_by( 'email', $_POST['username'] );
if ( isset( $user->user_login ) ) {