Skip to:
Content

BuddyPress.org

Changeset 11949


Ignore:
Timestamp:
04/04/2018 10:23:22 AM (7 years ago)
Author:
djpaul
Message:

Friends: fix friendship incremented cache purge consistency.

This was not being cleared when using either friends_remove_friend(),
friends_accept_friendship(), friends_reject_friendship(), or
friends_withdraw_friendship().

Fixes #7436

Props r-a-y

File:
1 edited

Legend:

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

    r11865 r11949  
    5252    // Clear the friendship object cache.
    5353    wp_cache_delete( $friendship_id, 'bp_friends_friendships' );
     54
     55    // Clear incremented cache.
     56    $friendship = new stdClass;
     57    $friendship->initiator_user_id = $initiator_user_id;
     58    $friendship->friend_user_id    = $friend_user_id;
     59    bp_friends_delete_cached_friendships_on_friendship_save( $friendship );
    5460}
    5561add_action( 'friends_friendship_requested', 'bp_friends_clear_bp_friends_friendships_cache', 10, 3 );
     
    7278    // Clear the friendship object cache.
    7379    wp_cache_delete( $friendship_id, 'bp_friends_friendships' );
     80
     81    // Clear incremented cache.
     82    bp_friends_delete_cached_friendships_on_friendship_save( $friendship );
    7483}
    7584add_action( 'friends_friendship_withdrawn', 'bp_friends_clear_bp_friends_friendships_cache_remove', 10, 2 );
Note: See TracChangeset for help on using the changeset viewer.