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


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


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


(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



Changelog Changelog

Version Description
MU (3.0.0) Introduced.


Leave a Reply

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