$blog ) { if( $blog[ 'blog_id' ] == $dashboard_blog || is_user_member_of_blog( $user_id, $blog[ 'blog_id' ] ) ) continue; switch_to_blog( $blog[ 'blog_id' ] ); $role = get_option( 'msum_default_user_role', 'none' ); // if no default set, use 'none' if( $role != 'none' ) add_user_to_blog( $blog[ 'blog_id' ], $user_id, $role ); restore_current_blog(); } } add_action( 'wpmu_activate_user', 'msum_activate_user', 10, 1 ); // For users activating both a blog and an account function msum_activate_blog_user( $blog_id, $user_id ){ msum_activate_user( $user_id, $blog_id ); } add_action( 'wpmu_activate_blog', 'msum_activate_blog_user', 10, 2 ); // Role assignment selection boxes on the 'Site Admin | Options' page function msum_options(){ ?>
'; printf( __('Whoops, it appears %s is not located in /wp-content/mu-plugins/', 'msum' ), '' . basename( __FILE__ ) . '' ); echo ''; echo ''; printf( __( 'It is currently located in %s. Please move it to /wp-content/mu-plugins/ for this plugin to work correctly.', 'msum' ), '' . dirname( __FILE__ ) . '' ); echo '
'; return; } $dashboard_blog = get_site_option( 'dashboard_blog' ); $blogs = get_blog_list( 0, 'all' ); if( empty( $blogs ) ) { echo '' . __( 'No public, safe sites available.', 'msum' ) . '
'; } else { echo '' . __( 'Select the default role for each of your sites.', 'msum' ) . '
'; echo '' . __( 'New users will receive these roles when activating their account. Existing users will receive these roles only if they have the current default role or no role at all for each particular site.', 'msum' ) . '
'; echo '