WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/add existing user to blog

Contents

Description

Add a user to the current blog based on details from maybe_add_existing_user_to_blog().

Note: 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

Change Log

Since: MU ( 3.0.0)

Source File

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

Related

maybe_add_existing_user_to_blog(), add_user_to_blog(), remove_user_from_blog(), add_new_user_to_blog()

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