Created
January 23, 2015 23:26
-
-
Save Willem-Siebe/9dfe4aaaaa24e1294da6 to your computer and use it in GitHub Desktop.
Change WooCommerce username to emailaddress, see http://stackoverflow.com/questions/24911432/wrong-username-and-displayname-after-user-registraton-woocommerce.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Change WooCommerce username to emailaddress, see https://gist.github.com/Willem-Siebe/9dfe4aaaaa24e1294da6. | |
add_filter('woocommerce_new_customer_data','wsis_change_wc_username'); | |
function wsis_change_wc_username($user_data) { | |
return array( | |
'user_login' => $user_data['user_email'], | |
'user_pass' => $user_data['user_pass'], | |
'user_email' => $user_data['user_email'], | |
'role' => 'customer'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment