wp_create_user

Advertisement

Summery Summery

A simpler way of inserting a user into the database.

Syntax Syntax

wp_create_user( string $username, string $password, string $email = '' )

Description Description

Creates a new user with just the username, password, and email. For more complex user creation use wp_insert_user() to specify more information.

Parameters Parameters

$username

(Required) The user's username.

$password

(Required) The user's password.

$email

(Optional) The user's email.

Default value: ''

Return Return

(int|WP_Error) The newly created user's ID or a WP_Error object if the user could not be created.

Source Source

File: wp-includes/user.php

/**
 * A simpler way of inserting a user into the database.
 *
 * Creates a new user with just the username, password, and email. For more
 * complex user creation use wp_insert_user() to specify more information.
 *
 * @since 2.0.0

Advertisement

Changelog Changelog

Changelog
Version Description
2.0.0 Introduced.

See also See also

Advertisement

Leave a Reply