Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: How do I check if a particular profile is a friend’s?


r-a-y
Keymaster

@r-a-y

Check out the friends_check_friendship() function in /bp-friends.php.

The parameters are:
friends_check_friendship( $user_id, $possible_friend_id )

And it returns true if the person is a friend.

Example:

global $bp;

$is_friend = friends_check_friendship( $bp->loggedin_user->id, $bp->displayed_user->id );

if ( $is_friend ) {
run your custom code;
}

Skip to toolbar