BP_Friends_Friendship::get_friendship_request_user_ids( int $user_id )

Get a list of IDs of users who have requested friendship of a given user.

Parameters Parameters


(int) (Required) The ID of the user who has received the friendship requests.

Top ↑

Return Return

(array|bool) An array of user IDs, or false if none are found.

Source Source

File: bp-friends/classes/class-bp-friends-friendship.php

	public static function get_friendship_request_user_ids( $user_id ) {
		$friend_requests = wp_cache_get( $user_id, 'bp_friends_requests' );

		if ( false === $friend_requests ) {
			$friend_requests = self::get_friend_user_ids( $user_id, true );

			wp_cache_set( $user_id, $friend_requests, 'bp_friends_requests' );

		// Integer casting.
		if ( ! empty( $friend_requests ) ) {
			$friend_requests = array_map( 'intval', $friend_requests );

		return $friend_requests;

Top ↑

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.