Function: update_user_status

update_user_status( integer $id, string $pref, integer $value, null $deprecated )

Update the status of a user in the database.

Used in core to mark a user as spam or "ham" (not spam) in Multisite.

Parameters

Name Type(s) Default Value Description
$id integer

The user ID.

$pref string

The column in the wp_users table to update the user's status in (presumably user_status, spam, or deleted).

$value integer

The new status for the user.

$deprecated null null

Deprecated as of 3.0.2 and should not be used.

Returns

integer

The initially passed $value.

WordPress Developer Newsletter

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