Role not completely propagating…
-
Hello –
I’m using multi-site and using role editor.
I have some code that automatically adds the headmaster to every site that gets created (so that all posts may be reviewed by her )
I have some working code that works, but it’s not completely setting the role to Headmaster in the user profile of the newly created site.
This is the code I’m using:
function caprock_new_user_meta($blog_id, $user_id) { $args = array( 'blog_id' => '1', 'meta_key' => 'position', 'meta_value' => 'headmaster', ); $headmasters = get_users($args); foreach ( $headmasters as $author ) { $userid = $author->ID; add_user_to_blog($blog_id, $userid, 'Headmaster' ); } // End Foreach Headmaster } add_action( 'wpmu_new_blog', 'caprock_new_user_meta', 10, 2 );
This is allowing her to be added, but I suspect that when I’m calling ass_user_to_blog() that there might be a complimentary call in User Role Editor that needs to be made as well…
Thoughts?
When I go to look at her newly created profile, the role says it’s not defined ( or something like that), and I select it from the drop down and save and all is good.
Thanks
Matt
- The topic ‘Role not completely propagating…’ is closed to new replies.