Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/20/2016 02:42:10 PM (8 years ago)
Author:
dcavins
Message:

Introduce BP_Friends_Friendships::get_friendships().

Introduce a new function, BP_Friends_Friendships::get_friendships(),
for fetching and filtering friendships for a
specific user. Also add a new cache group,
bp_friends_friendships_for_user that
get_friendships() interacts with.

This is the second step in moving toward a
split cache approach for friendships.

Props dcavins, boonebgorges.

See #6978.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-friends/bp-friends-cache.php

    r11122 r11123  
    4646 */
    4747function bp_friends_clear_bp_friends_friendships_cache( $friendship_id, $initiator_user_id, $friend_user_id ) {
     48    // Clear friendship ID cache for each user.
     49    wp_cache_delete( $initiator_user_id, 'bp_friends_friendships_for_user' );
     50    wp_cache_delete( $friend_user_id,    'bp_friends_friendships_for_user' );
     51
    4852    // Clear the friendship object cache.
    4953    wp_cache_delete( $friendship_id, 'bp_friends_friendships' );
     
    6266 */
    6367function bp_friends_clear_bp_friends_friendships_cache_remove( $friendship_id, BP_Friends_Friendship $friendship ) {
     68    // Clear friendship ID cache for each user.
     69    wp_cache_delete( $friendship->initiator_user_id, 'bp_friends_friendships_for_user' );
     70    wp_cache_delete( $friendship->friend_user_id,    'bp_friends_friendships_for_user' );
     71
    6472    // Clear the friendship object cache.
    6573    wp_cache_delete( $friendship_id, 'bp_friends_friendships' );
Note: See TracChangeset for help on using the changeset viewer.