woocommerce_get_username_from_email filter for login Closes #4791
This commit is contained in:
parent
5c22b36cb7
commit
5564e49b15
|
@ -726,7 +726,7 @@ class WC_Form_Handler {
|
||||||
throw new Exception( '<strong>' . __( 'Error', 'woocommerce' ) . ':</strong> ' . __( 'Password is required.', 'woocommerce' ) );
|
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'] );
|
$user = get_user_by( 'email', $_POST['username'] );
|
||||||
|
|
||||||
if ( isset( $user->user_login ) ) {
|
if ( isset( $user->user_login ) ) {
|
||||||
|
|
Loading…
Reference in New Issue