Function: wpmu_create_user

wpmu_create_user( string $user_name, string $password, string $email )

Create a user.

This function runs when a user self-registers as well as when a Super Admin creates a new user. Hook to \'wpmu_new_user' for events that should affect all new users, but only on Multisite (otherwise use See'user_register').


Name Type(s) Default Value Description
$user_name string

The new user's login name.

$password string

The new user's password.

$email string

The new user's email address.


integer | false

Returns false on failure, or int $user_id on success

WordPress Developer Newsletter

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