Automatically add new users to BuddyPress group

function chet_tips_automatic_group_membership( $user_id ) {

 if( !$user_id ) return false;

 groups_accept_invite( $user_id, <# group ID #> );

}

add_action( 'bp_core_activated_user', 'chet_tips_automatic_group_membership' );

Leave a comment

Your email address will not be published. Required fields are marked *

%d bloggers like this: