From 5564e49b1542b4ef9b254bb8afcd921d99ea6cea Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Fri, 14 Feb 2014 11:47:12 +0000 Subject: [PATCH] woocommerce_get_username_from_email filter for login Closes #4791 --- includes/class-wc-form-handler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-form-handler.php b/includes/class-wc-form-handler.php index d5591d7879e..c71f22fd4fb 100644 --- a/includes/class-wc-form-handler.php +++ b/includes/class-wc-form-handler.php @@ -726,7 +726,7 @@ class WC_Form_Handler { throw new Exception( '' . __( 'Error', 'woocommerce' ) . ': ' . __( '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 ) ) {