update_user_status()更新用户状态

目录

描述

Update the status of a user in the database. Used in core to mark a user as spam or "ham" (not spam) on multisite installs.

update_user_status() 描述

用法

<?php update_user_status$id$pref$value ); ?>

update_user_status() 用法

参数

$id

(integer) (必填) The ID of the user.

默认值: None

$pref

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

默认值: None

$value

(integer) (必填) The new status for the user.

默认值: None

$deprecated

(null) (可选) This parameter is deprecated and should not be used.

默认值: null

update_user_status() 参数

示例

Mark a User as Spam

Note: You can only do this on multisite installs!

Mark a User as Ham

Again, this will not work on single site installs.

update_user_status() 示例

注意

update_user_status() 注意

历史

  • 3.0.2: The $refresh parameter was deprecated.
  • 添加于 版本: 3.0.0

update_user_status() 历史

源文件

update_user_status() 函数的代码位于 wp-admin/includes/ms.php.

update_user_status() 源文件