woocommerce_get_username_from_email filter for login Closes #4791
This commit is contained in:
parent
8a2a5b06c6
commit
e667d41497
|
@ -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 ) ) {
|
||||
|
|
Loading…
Reference in New Issue