BP_Friends_Friendship::get_user_ids_for_friendship( int $friendship_id )

Get the friend user IDs for a given friendship.


Description Description


Parameters Parameters

$friendship_id

(Required) ID of the friendship.


Top ↑

Return Return

(null|stdClass) friend_user_id and initiator_user_id.


Top ↑

Source Source

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

	public static function get_user_ids_for_friendship( $friendship_id ) {

		$friendship = new BP_Friends_Friendship( $friendship_id, false, false );

		if ( empty( $friendship->id ) ) {
			return null;
		}

		$retval = new StdClass;
		$retval->friend_user_id = $friendship->friend_user_id;
		$retval->initiator_user_id = $friendship->initiator_user_id;

		return $retval;
	}

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.