Changeset 13971 for trunk/src/bp-friends/bp-friends-cache.php
- Timestamp:
- 07/23/2024 01:32:42 AM (18 months ago)
- File:
-
- 1 edited
-
trunk/src/bp-friends/bp-friends-cache.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-friends/bp-friends-cache.php
r13092 r13971 3 3 * BuddyPress Friends Caching. 4 4 * 5 * Caching functions handle the clearing of cached objects and pages on specific6 * actions throughout BuddyPress.7 *8 5 * @package BuddyPress 9 * @subpackage FriendsCach ing6 * @subpackage FriendsCache 10 7 * @since 1.5.0 11 8 */ … … 21 18 * @param int $friendship_id ID of the friendship whose two members should 22 19 * have their friends cache busted. 23 * @return bool24 20 */ 25 21 function friends_clear_friend_object_cache( $friendship_id ) { 26 22 $friendship = new BP_Friends_Friendship( $friendship_id ); 27 if ( ! $friendship ) { 28 return false; 23 24 if ( empty( $friendship->id ) ) { 25 return; 29 26 } 30 27 … … 55 52 56 53 // Clear incremented cache. 57 $friendship = new stdClass;54 $friendship = new stdClass(); 58 55 $friendship->initiator_user_id = $initiator_user_id; 59 56 $friendship->friend_user_id = $friend_user_id; … … 135 132 * @since 3.0.0 136 133 * 137 * @param BP_Friends_Friendship $friendship The friendship object.134 * @param BP_Friends_Friendship|stdClass $friendship The friendship object. 138 135 */ 139 136 function bp_friends_delete_cached_friendships_on_friendship_save( $friendship ) { … … 144 141 145 142 // List actions to clear super cached pages on, if super cache is installed. 146 add_action( 'friends_friendship_rejected', 'bp_core_clear_cache' );147 add_action( 'friends_friendship_accepted', 'bp_core_clear_cache' );148 add_action( 'friends_friendship_deleted', 'bp_core_clear_cache' );143 add_action( 'friends_friendship_rejected', 'bp_core_clear_cache' ); 144 add_action( 'friends_friendship_accepted', 'bp_core_clear_cache' ); 145 add_action( 'friends_friendship_deleted', 'bp_core_clear_cache' ); 149 146 add_action( 'friends_friendship_requested', 'bp_core_clear_cache' );
Note: See TracChangeset
for help on using the changeset viewer.