friends_check_user_has_friends( int $user_id )

Check whether a given user has any friends.


Parameters Parameters

$user_id

(int) (Required) ID of the user whose friends are being checked.


Top ↑

Return Return

(bool) True if the user has friends, otherwise false.


Source Source

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

function friends_check_user_has_friends( $user_id ) {
	$friend_count = friends_get_total_friend_count( $user_id );

	if ( empty( $friend_count ) )
		return false;

	if ( !(int) $friend_count )
		return false;

	return true;
}


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.