Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: how to add new members to groups automatically?

@5high

Participant

Hi @mrjarbenne,

Thanks so much for helping – I’ve only just found your reply (don’t know what happened to the email notification this time). Anyway, I’ve added it into my bp-custom.php as suggested and Bingo! it works brilliantly. just tried a new test member and I’m instant joined to all 3 of my groups!

Thanks so much for this. Just for clarity for others this is the code i used as per @modemlooper info above:

function automatic_group_membership( $user_id ) {
   if( !$user_id ) return false;
 
   groups_accept_invite( $user_id, $group_id );
}
add_action( 'bp_core_activated_user', 'automatic_group_membership' );

I have left the spacing exactly as he’d done, just in case… but maybe I could get rid of some of the extra spaces in it?

Cheers 🙂

Skip to toolbar