Checks if two users are friends. This buddypress function is used to check the friendship status of two users. It returns the friendship status as a string.
friends_check_friendship_status($user_id, $possible_friend_id )
The functions requires two WordPress user ids to calculate if both of them are friends or not. Both user ids are required.
This function returns the status in string format. The returned string will be one of the following values:
/* * Retrieves friendship status between currently logged in user id and user whose profile is being viewed */ $user_id = get_current_user_id(); $possible_friend_id = bp_displayed_user_id(); $friendship_status = friends_check_friendship_status($user_id, $possible_friend_id); echo $friendship_status;