refresh_user_details

Cleans the user cache for a specific user.

Description

(bool|int) refresh_user_details( (int) $id ); 

Returns (bool|int)

The ID of the refreshed user or false if the user does not exist.

Parameters (1)

0. $id (int)
The user ID.

Usage

  1. if ( !function_exists( 'refresh_user_details' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/ms.php'; 
  3.  
  4. // The user ID. 
  5. $id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = refresh_user_details($id); 
  9.  

Defined (1)

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

/wp-admin/includes/ms.php  
  1. function refresh_user_details( $id ) { 
  2. $id = (int) $id; 
  3.  
  4. if ( !$user = get_userdata( $id ) ) 
  5. return false; 
  6.  
  7. clean_user_cache( $user ); 
  8.  
  9. return $id;