AI Verified

Name

Set Username based on Email - WooCommerce

About

This code adds a filter to the WooCommerce new customer data, so that the user login is automatically set to the user's email address.

Language

PHP

Rating

Voted: 0 by 0 user(s)

Codevault

FP---Codevault

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: 6.1

Our AI bot has checked this snippet is compatable up to wordpress version: 6.1

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

Website/ Profile URL:

https://frankpurcell.co.za

History

Last modified:

31/10/2023

Important Note

This snippet has the following status:

AI Verified

This snippet has been tested by our AI bot, see any comments below.

AI Bot Comments:

Found 0 vulnerabilities

Set Username based on Email - WooCommerce

 
                    
1add_filter( 'woocommerce_new_customer_data', function( $data ) {
2 $data['user_login'] = $data['user_email'];
3 
4 return $data;
5} );

0

Featured Snippet

Related Snippets

Please see some snippets below related to this snippet..

WooCommerce

AI Verified

0

WooCommerce Custom Radio Button Field For Product Editor

Added: 1 year ago

Last Updated: 1 year ago

This guide shows you how to create custom radio buttons in the product editor of WooCommerce. This is perfect if you need to be able to select a pre-defined series of options in the backend and displa...

WooCommerce

AI Verified

0

WooCommerce Remove Checkout Button From Mini Cart

Added: 1 year ago

Last Updated: 1 year ago

This guide shows you how you can remove the checkout button from the mini cart, forcing users to view their cart before proceeding to the checkout. You may find the button still appears after implemen...

WooCommerce

AI Verified

1

WooCommerce Checkout Change “Ship To A Different Address” Heading

Added: 1 year ago

Last Updated: 2 weeks ago

Based on your store location, some titles will say “Deliver” instead of “Ship”. Whatever your checkout says, you need to make your code say this. Replace as needed in order to customise the text for y...

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

WooCommerce

AI Verified

1

Remove WooCommerce Lightbox Zoom

Added: 1 year ago

Last Updated: 2 weeks ago

Remove the zoom and lightbox features from the WooCommerce product gallery.

WooCommerce

AI Verified

0

WooCommerce Shipping Method Button

Added: 1 year ago

Last Updated: 1 year ago

WooCommerce

AI Verified

0

WooCommerce - My Account - Edit Address - Fix

Added: 1 year ago

Last Updated: 1 year ago

Fixes the issue with the "Edit Address" text missing from the user's My Account menu. This happens due to a language conflict when using English (South African/US), however using English (UK) also res...