friends_check_friendship( int $user_id, int $possible_friend_id )

Check whether two users are friends.

Description

Parameters

$user_id

(Required) ID of the first user.

$possible_friend_id

(Required) ID of the other user.

Return

(bool) Returns true if the two users are friends, otherwise false.

Source

File: bp-friends/bp-friends-functions.php

function friends_check_friendship( $user_id, $possible_friend_id ) {

	if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( $user_id, $possible_friend_id ) )
		return true;

	return false;
}

Changelog

Changelog
Version Description
BuddyPress 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.