Forums
-
- Forum
- Posts
-
- Installing BuddyPress
- 24,005
- How-to & Troubleshooting
- 129,527
- Creating & Extending
- 25,790
- Requests & Feedback
- 9,496
- Third Party Plugins
- 9,782
- Showcase
- 3,316
- Ideas
- 1,397
- Miscellaneous
- 9,170
-
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