wpseek.com
WordPress开发者和主题制作者的搜索引擎
add_new_user_to_blog › WordPress Function
Since
已弃用n/a
› add_new_user_to_blog ( $user_id, $password, $meta )
参数: (3) |
|
查看: | |
定义在: |
|
文档: | |
Change Log: |
|
Adds a newly created user to the appropriate blog
To add a user in general, use add_user_to_blog(). This function is specifically hooked into the {@see 'wpmu_activate_user'} action.Related Functions: add_user_to_blog, add_existing_user_to_blog, maybe_add_existing_user_to_blog, get_users_of_blog, insert_blog
源码
function add_new_user_to_blog( $user_id, $password, $meta ) { if ( ! empty( $meta['add_to_blog'] ) ) { $blog_id = $meta['add_to_blog']; $role = $meta['new_role']; remove_user_from_blog( $user_id, get_network()->site_id ); // Remove user from main blog. $result = add_user_to_blog( $blog_id, $user_id, $role ); if ( ! is_wp_error( $result ) ) { update_user_meta( $user_id, 'primary_blog', $blog_id ); } } }