Forums
-
- Forum
- Posts
-
- Installing BuddyPress
- 23,693
- How-to & Troubleshooting
- 128,248
- Creating & Extending
- 25,680
- Requests & Feedback
- 9,405
- Third Party Plugins
- 9,754
- Showcase
- 3,321
- Ideas
- 1,349
- Miscellaneous
- 8,879
-
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