Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Use the submitted email address for the username in WooCommerce registration.
add_filter( 'woocommerce_new_customer_data', function( $data ) {
$data['user_login'] = $data['user_email'];
return $data;
} );

This comment has been minimized.

Copy link

commented Jul 7, 2017

Is this the write code you write above??
I want to change username in user email id and autogenerated password in his/her phone number in the below email template. Do you have any idea how i do it?

' . esc_html( $user_login ) . '' ); ?>

' . esc_html( $user_pass ) . '' ); ?>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.