add_user() WordPress Function

The add_user() function allows you to create a new user in WordPress. This function takes two arguments: the user's login name and their password. You can use this function to create a new user when someone signs up for your website. For example, if someone signs up for your website using their Facebook account, you can use this function to create a new WordPress user for them. Once you have created a new user, you can then use the other WordPress user functions to assign them roles and capabilities.

add_user() #

Creates a new user from the “Users” form using $_POST information.


Return

(int|WP_Error) WP_Error or User ID.


Top ↑

Source

File: wp-admin/includes/user.php

function add_user() {
	return edit_user();
}


Top ↑

Changelog

Changelog
VersionDescription
2.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.