[buddypress-trac] [BuddyPress Trac] #6218: bp_friend_get_total_requests_count() could use already cached data
buddypress-trac
noreply at wordpress.org
Thu Feb 12 17:10:53 UTC 2015
#6218: bp_friend_get_total_requests_count() could use already cached data
---------------------------------+-----------------------------
Reporter: wpdennis | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Component - Friends | Version:
Severity: normal | Keywords: 2nd-opinion
---------------------------------+-----------------------------
[https://buddypress.trac.wordpress.org/browser/tags/2.2.0/src/bp-friends
/bp-friends-template.php#L614 bp_friend_get_total_requests_count()] calls
[https://buddypress.trac.wordpress.org/browser/tags/2.2.0/src/bp-friends
/bp-friends-classes.php#L196 BP_Friends_Friendship::get_friend_user_ids(
$user_id, true )]:
{{{
return apply_filters( 'bp_friend_get_total_requests_count', count(
BP_Friends_Friendship::get_friend_user_ids( $user_id, true ) ) );
}}}
But ''get_friend_user_ids()'' never caches the result. If it would use
[https://buddypress.trac.wordpress.org/browser/tags/2.2.0/src/bp-friends
/bp-friends-classes.php#L242 get_friendship_request_user_ids()] instead,
it would access already cached data:
{{{
return apply_filters( 'bp_friend_get_total_requests_count', count(
BP_Friends_Friendship::get_friendship_request_user_ids( $user_id ) ) );
}}}
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6218>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list