bp_friends_clear_bp_friends_friendships_cache_remove( int $friendship_id, BP_Friends_Friendship $friendship )

Clear friendship caches on friendship changes.


Parameters Parameters

$friendship_id

(int) (Required) The friendship ID.

$friendship

(BP_Friends_Friendship) (Required) Friendship object.


Source Source

File: bp-friends/bp-friends-cache.php

function bp_friends_clear_bp_friends_friendships_cache_remove( $friendship_id, BP_Friends_Friendship $friendship ) {
	// Clear friendship ID cache for each user.
	wp_cache_delete( $friendship->initiator_user_id, 'bp_friends_friendships_for_user' );
	wp_cache_delete( $friendship->friend_user_id,    'bp_friends_friendships_for_user' );

	// Clear the friendship object cache.
	wp_cache_delete( $friendship_id, 'bp_friends_friendships' );

	// Clear incremented cache.
	bp_friends_delete_cached_friendships_on_friendship_save( $friendship );
}


Top ↑

Changelog Changelog

Changelog
Version Description
2.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.