Skip to content

Instantly share code, notes, and snippets.

@JustinSainton
Created January 27, 2016 03:35
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JustinSainton/b5551532dc6034d25f38 to your computer and use it in GitHub Desktop.
Save JustinSainton/b5551532dc6034d25f38 to your computer and use it in GitHub Desktop.
Use the submitted email address for the username in WooCommerce registration.
<?php
add_filter( 'woocommerce_new_customer_data', function( $data ) {
$data['user_login'] = $data['user_email'];
return $data;
} );
@sup077
Copy link

sup077 commented Jul 7, 2017

Heya
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