add_new_user_to_blog [ WordPress Function ]
add_new_user_to_blog ( $user_id, $email, $meta )
| Parameters: |
|
| Defined at: |
|
Soorgelijke functies: add_user_to_blog, add_existing_user_to_blog, maybe_add_existing_user_to_blog, get_users_of_blog, insert_blog
Add a newly created user to the appropriate blog
Source
<?php
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 );
}
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- add_new_user_to_blog (WordPress Function) - WPSeek.com
WordPress lookup for add_new_user_to_blog, a WordPress Function. wpseek. com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - #15173 (duplicate calls to 'add_new_user_to_blog') – WordPress Trac
That means that the default behavior is to call add_new_user_to_blog twice. This triggers the actions attached to add_user_to_blog to fire twice. While removing ...
core.trac.wordpress.org - Docs for page ms-functions.php
void add_new_user_to_blog (int $user_id, string $email, array $meta). int $ user_id; string $email; array $meta. add_user_to_blog (line 183). Add a user to a ...
phpdoc.wordpress.org - add_new_user_to_blog | A HitchHackers guide through WordPress
Feb 11, 2011 ... function add_new_user_to_blog( $user_id, $email, $meta ) { global $current_site ; if ( !empty( $meta[ 'add_to_blog' ] ) ) { $blog_id = $meta[ ...
hitchhackerguide.com