Codex

Function Reference/add existing user to blog

This page is marked as incomplete. You can help Codex by expanding it.

Contents

Description

Add a user to the current blog based on details from maybe_add_existing_user_to_blog(). This function is called by maybe_add_existing_user_to_blog() and should not be called directly. This page is for informational purposes only.

Usage

<?php add_existing_user_to_blog$details ?>

Parameters

$details
(array) (optional) Must at least contain values for the keys listed below
Default: false(which will cause a failure)
  • $details['user_id'] - (integer) the ID of the user being added to the current blog
  • $details['role'] - (string) the role to be assigned to the user in the current blog

Return Value

(WP_Error object|boolean) 
WP_Error on failure, True on success

Notes

Uses global $blog_id

Change Log

Since: MU

Source File

add_existing_user_to_blog() is located in wp-includes/ms-functions.php

Related

 

See also index of Function Reference and index of Template Tags.