首页 WordPress函数大全 add_user_to_blog()

add_user_to_blog()

2020-05-01 / 3063阅 / 悠然

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

add_user_to_blog( int $blog_id, int $user_id, string $role )

Adds a user to a blog.

描述

Use the ‘add_user_to_blog’ action to fire an event when users are added to a blog.

参数

$blog_id

(int)
(Required)
ID of the blog the user is being added to.

$user_id

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

$role

(string)
(Required)
The role you want the user to have

返回

(true|WP_Error) True>WP_Error object if the user doesn't exist or could not be added.

大家谈论
    我的见解