Function: register_new_user

register_new_user( string $user_login, string $user_email )

Handles registering a new user.

Parameters

Name Type(s) Default Value Description
$user_login string

User's username for logging in

$user_email string

User's email address to send password and add

Returns

integer | WP_Error

Either user's ID or error on failure.

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.