bp_get_potential_friend_id( int $user_id )

Return the ID of current user in the friend request loop.


Parameters Parameters

$user_id

(int) (Optional) If provided, the function will simply return this value.


Top ↑

Return Return

(int) ID of potential friend.


Source Source

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

	function bp_get_potential_friend_id( $user_id = 0 ) {
		global $friends_template;

		if ( empty( $user_id ) && isset( $friends_template->friendship->friend ) )
			$user_id = $friends_template->friendship->friend->id;
		elseif ( empty( $user_id ) && !isset( $friends_template->friendship->friend ) )
			$user_id = bp_displayed_user_id();

		/**
		 * Filters the ID of current user in the friend request loop.
		 *
		 * @since 1.2.10
		 *
		 * @param int $user_id ID of current user in the friend request loop.
		 */
		return apply_filters( 'bp_get_potential_friend_id', (int) $user_id );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.2.6 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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