首页 WordPress函数大全 remove_user_from_blog()

remove_user_from_blog()

2020-05-02 / 5371阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

remove_user_from_blog( int $user_id, int $blog_id, int $reassign )

从博客中删除用户。

描述

当用户从博客中删除时,请使用“ remove_user_from_blog”操作来触发事件。

如果要在删除后将用户的博客文章重新分配给另一个用户,则接受一个可选的$ reassign参数。

参数

$user_id

(int)
(Required)
ID of the user being removed.

$blog_id

(int)
(Optional)
ID of the blog the user is being removed from. Default 0.

$reassign

(int)
(Optional)
ID of the user to whom to reassign posts. Default 0.

返回

(true|WP_Error) True>WP_Error object if the user doesn't exist.

大家谈论
    我的见解