Categories
BuddyPress WordPress

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' );
Categories
BuddyPress WordPress

BuddyPress how to check friendship status of two users.

$member_friend_status = friends_check_friendship_status( $user1, $user2 );
Categories
BuddyPress WordPress

How to get member id in BuddyPress member loop

$member_id = bp_get_member_user_id();