Skip to content

Instantly share code, notes, and snippets.

@Willem-Siebe
Created January 23, 2015 23:26
Show Gist options
  • Save Willem-Siebe/9dfe4aaaaa24e1294da6 to your computer and use it in GitHub Desktop.
Save Willem-Siebe/9dfe4aaaaa24e1294da6 to your computer and use it in GitHub Desktop.
// 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