add_user_to_blog

Advertisement

Summery Summery

Adds a user to a blog.

Syntax Syntax

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

Description Description

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

Parameters Parameters

$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

Return Return

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

Source Source

File: wp-includes/ms-functions.php


			

Advertisement

Changelog Changelog

Changelog
Version Description
MU (3.0.0) Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.