Commit f2a20bee authored by Christian Wach's avatar Christian Wach
Browse files

Add users to main site when adding to Groups groups

parent 0cab2304
......@@ -187,6 +187,14 @@ class CiviCRM_Network_Groups_WordPress {
return;
}
// Switch to main site.
$this->plugin->hooks->switch_to_main_site( true );
// Maybe add user.
if ( ! is_user_member_of_blog( $user_id, get_main_site_id() ) ) {
add_user_to_blog( get_main_site_id(), $user_id, get_option( 'default_role' ) );
}
// Parse our groups and data.
foreach( $synced_groups AS $group ) {
......@@ -209,6 +217,9 @@ class CiviCRM_Network_Groups_WordPress {
}
// Switch back.
$this->plugin->hooks->switch_back( true );
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment