WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Difference between revisions of "Function Reference/wpmu create user"

(Created page with "== Description == 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 …")
 
(Added a bit more detail in the description)
Line 1: Line 1:
 
== Description ==
 
== Description ==
   
Create a user.
+
Create a user using strict username sanitization: only alphanumeric, _, ., -, and/or @ are allowed.
   
 
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 'user_register').
 
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 'user_register').

Revision as of 12:58, 3 April 2012

Description

Create a user using strict username sanitization: only alphanumeric, _, ., -, and/or @ are allowed.

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 'user_register').

Usage

<?php wpmu_create_user$user_name$password$email ); ?>

Parameters

$user_name
(string) (required) The new user's login name.
Default: None
$password
(string) (required) The new user's password.
Default: None
$email
(string) (required) The new user's email address.
Default: None

Return Values

(mixed) 
Returns false on failure, or int $user_id on success

Source File

wpmu_create_user() is located in wp-includes/ms-functions.php