bp_core_clear_user_object_cache

Clear all cached objects for a user, or those that a user is part of.

Description

bp_core_clear_user_object_cache( (string) $user_id ); 

Parameters (1)

0. $user_id (string)
User ID to delete cache for.

Usage

  1. if ( !function_exists( 'bp_core_clear_user_object_cache' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-cache.php'; 
  3.  
  4. // User ID to delete cache for. 
  5. $user_id = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_core_clear_user_object_cache($user_id); 
  9.  

Defined (1)

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

/bp-core/bp-core-cache.php  
  1. function bp_core_clear_user_object_cache( $user_id ) { 
  2. wp_cache_delete( 'bp_user_' . $user_id, 'bp' );