Merge pull request #6702 from tivnet/patch-3

Update class-wc-shortcode-my-account.php
This commit is contained in:
Barry Kooij 2014-11-11 10:29:49 +01:00
commit d02beb5610
1 changed files with 2 additions and 1 deletions

View File

@ -224,6 +224,7 @@ class WC_Shortcode_My_Account {
if ( empty( $_POST['user_login'] ) ) {
wc_add_notice( __( 'Enter a username or e-mail address.', 'woocommerce' ), 'error' );
return false;
} else {
// Check on username first, as customers can use emails as usernames.
@ -231,7 +232,7 @@ class WC_Shortcode_My_Account {
$user_data = get_user_by( 'login', $login );
}
// If no user found, check if it login is emaill and lookup user based on email.
// If no user found, check if it login is email and lookup user based on email.
if ( ! $user_data && is_email( $_POST['user_login'] ) && apply_filters( 'woocommerce_get_username_from_email', true ) ) {
$user_data = get_user_by( 'email', trim( $_POST['user_login'] ) );
}