friends_get_friend_user_ids( int $user_id, bool $friend_requests_only = false, bool $assoc_arr = false )

Get the IDs of a given user’s friends.

Description

Parameters

$user_id

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

$friend_requests_only

(Optional) Whether to fetch unaccepted requests only. Default: false.

Default value: false

$assoc_arr

(Optional) True to receive an array of arrays keyed as 'user_id' => $user_id; false to get a one-dimensional array of user IDs. Default: false.

Default value: false

Return

(array)

Source

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

function friends_get_friend_user_ids( $user_id, $friend_requests_only = false, $assoc_arr = false ) {
	return BP_Friends_Friendship::get_friend_user_ids( $user_id, $friend_requests_only, $assoc_arr );
}

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.