Codex

Function Reference/wp update user

Contents

Description

Update (or create) a user in the database.

It is possible to update a user's password by specifying the 'user_pass' value in the $userdata parameter array.

If $userdata does not contain an 'ID' key, then a new user will be created and the new user's ID will be returned.

If current user's password is being updated, then the cookies will be cleared.

Usage

<?php wp_update_user$userdata ?>

Parameters

$userdata
(array) (required) An array of user data.
Default: None

Return Values

(integer) 
The updated user's ID.

Examples

Notes

Change Log

Since: 2.0.0

Source File

wp_update_user() is located in wp-includes/registration.php.

Related