wpmem_create_username_from_email()

Description

Creates a username from the email address provided.

If WooCommerce is installed, it will use wc_create_new_customer_username() to generate a username. Otherwise, it will begin with the first part of the user’s email address. That is checked for uniqueness in the wp_users table. If it is not unique, it will add an integer to the end until it finds a unique value.

Parameters

$email
(string) (required) The email address to convert.

Changelog

Introduced in version 3.4.6

Source

wpmem_create_username_from_email() is located in /inc/api-users.php.

Leave a Reply