WordPress Version: 5.7
/**
* Cleans the user cache for a specific user.
*
* @since 3.0.0
*
* @param int $id The user ID.
* @return int|false The ID of the refreshed user or false if the user does not exist.
*/
function refresh_user_details($id)
{
$id = (int) $id;
$user = get_userdata($id);
if (!$user) {
return false;
}
clean_user_cache($user);
return $id;
}