friends_get_friend_count_for_user( int $user_id )

Get a total friend count for a given user.

Description

Parameters

$user_id

(int) (Optional) ID of the user whose friendships you are counting. Default: displayed user (if any), otherwise logged-in user.

Return

(int) Connection count for the user.

Source

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

function friends_get_friend_count_for_user( $user_id ) {
	return BP_Friends_Friendship::total_friend_count( $user_id );
}

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.