bp_friends_clear_request_cache_on_save

Clear the friend request cache when a friendship is saved.

Description

bp_friends_clear_request_cache_on_save( (int) $friendship_id, (int) $initiator_user_id, (int) $friend_user_id ); 

A friendship is deemed saved when a friendship is requested or accepted.

Parameters (3)

0. $friendship_id (int)
The friendship id.
1. $initiator_user_id (int)
The user ID initiating the friendship.
2. $friend_user_id (int)
The user ID not initiating the friendship.

Usage

  1. if ( !function_exists( 'bp_friends_clear_request_cache_on_save' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-friends/bp-friends-cache.php'; 
  3.  
  4. // The friendship id. 
  5. $friendship_id = -1; 
  6.  
  7. // The user ID initiating the friendship. 
  8. $initiator_user_id = -1; 
  9.  
  10. // The user ID not initiating the friendship. 
  11. $friend_user_id = -1; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = bp_friends_clear_request_cache_on_save($friendship_id, $initiator_user_id, $friend_user_id); 
  15.  

Defined (1)

The function is defined in the following location(s).

/bp-friends/bp-friends-cache.php  
  1. function bp_friends_clear_request_cache_on_save( $friendship_id, $initiator_user_id, $friend_user_id ) { 
  2. bp_friends_clear_request_cache( $friend_user_id );