bp_get_friend_friendship_id()
Return the ID of the friendship between the logged-in user and the current user in the loop.
Description Description
Return Return
(int) ID of the friendship.
Source Source
File: bp-friends/bp-friends-template.php
function bp_get_friend_friendship_id() {
global $members_template;
if ( !$friendship_id = wp_cache_get( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id() ) ) {
$friendship_id = friends_get_friendship_id( $members_template->member->id, bp_loggedin_user_id() );
wp_cache_set( 'friendship_id_' . $members_template->member->id . '_' . bp_loggedin_user_id(), $friendship_id, 'bp' );
}
/**
* Filters the ID of the friendship between the logged in user and the current user in the loop.
*
* @since 1.2.0
*
* @param int $friendship_id ID of the friendship.
*/
return apply_filters( 'bp_get_friend_friendship_id', $friendship_id );
}
Changelog Changelog
| Version | Description |
|---|---|
| 1.2.0 | Introduced. |