Reply To: Probleme using BP core functions
Thank you to both of you @henrywright and @shanebp !
I did have to wait for BP to be loaded. Now I can use the core functions.
Besides, I tried your code @henrywright but all my users seem to be friendless lol. Are you sure it’s the good function to use ? Coz in bp-friends-functions.php, friends_get_friend_count_for_user() is declared like this:
/**
* Get a total friend count for a given user.
*
* @param int $user_id Optional. ID of the user whose friendships you are
* counting. Default: displayed user (if any), otherwise logged-in user.
* @return int Friend count for the user.
*/
function friends_get_friend_count_for_user( $user_id ) {
return BP_Friends_Friendship::total_friend_count( $user_id );
}
So it does return only an int and not an array. Unless I don’t understand ^^