bp_friends_clear_request_cache

Clear the friend request cache for the user not initiating the friendship.

Description

bp_friends_clear_request_cache( (int) $friend_user_id ); 

Parameters (1)

0. $friend_user_id (int)
The user ID not initiating the friendship.

Usage

  1. if ( !function_exists( 'bp_friends_clear_request_cache' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-friends/bp-friends-cache.php'; 
  3.  
  4. // The user ID not initiating the friendship. 
  5. $friend_user_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_friends_clear_request_cache($friend_user_id); 
  9.  

Defined (1)

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

/bp-friends/bp-friends-cache.php  
  1. function bp_friends_clear_request_cache( $friend_user_id ) { 
  2. wp_cache_delete( $friend_user_id, 'bp_friends_requests' );