bp_get_friend_ids( int $user_id )

Get a comma-separated list of IDs of a user’s friends.


Parameters Parameters

$user_id

(int) (Optional) Default: the displayed user's ID, or the logged-in user's ID.


Top ↑

Return Return

(false|string) A comma-separated list of friend IDs if any are found, otherwise false.


Source Source

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

function bp_get_friend_ids( $user_id = 0 ) {

	if ( empty( $user_id ) )
		$user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();

	$friend_ids = friends_get_friend_user_ids( $user_id );

	if ( empty( $friend_ids ) )
		return false;

	return implode( ',', friends_get_friend_user_ids( $user_id ) );
}


Top ↑

Changelog Changelog

Changelog
Version Description
1.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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