set_current_user
set_current_user ( $id, $name = '' )
Parameters:- (int|null) id User ID.
- (string) name Optional. The user's username
See:Returns:- (WP_User) returns wp_set_current_user()
Defined at: - Introduced in WordPress: 2.0.1
- Deprecated in WordPress: 3.0.0
Description
Changes the current user by ID or name.Set $id to null and specify a name if you do not know a user's ID.