Definition:
function add_new_user_to_blog( $user_id, $email, $meta ) {}
Add a newly created user to the appropriate blog
Parameters
- int $user_id
- string $email
- array $meta
Source code
function add_new_user_to_blog( $user_id, $email, $meta ) {
global $current_site;
if ( !empty( $meta[ 'add_to_blog' ] ) ) {
$blog_id = $meta[ 'add_to_blog' ];
$role = $meta[ 'new_role' ];
remove_user_from_blog($user_id, $current_site->blog_id); // remove user from main blog.
add_user_to_blog( $blog_id, $user_id, $role );
update_user_meta( $user_id, 'primary_blog', $blog_id );
}
}
261

February 11, 2011 


No comments yet... Be the first to leave a reply!