Forums
-
- Forum
- Posts
-
- Installing BuddyPress
- 23,840
- How-to & Troubleshooting
- 128,798
- Creating & Extending
- 25,728
- Requests & Feedback
- 9,439
- Third Party Plugins
- 9,772
- Showcase
- 3,317
- Ideas
- 1,387
- Miscellaneous
- 9,125
-
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;
}
See also: WordPress.org • bbPress.org • BuddyPress.org • Matt • Blog RSS