WordPress at a glance
function is not described

set_current_user() WP 2.0.1

Deprecated in 3.0.0. It is no longer supported and can be removed in future releases. Use wp_set_current_user() instead.

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.

  • See: wp_set_current_user()

No Hooks.

Return

WP_User. returns wp_set_current_user()

Usage

set_current_user( $id, $name );
$id(int/null) (required)
User ID.
$name(string)
The user's username
Default: ''

Code of set current user: wp-includes/pluggable-deprecated.php VER 5.0.3

<?php
function set_current_user($id, $name = '') {
	_deprecated_function( __FUNCTION__, '3.0.0', 'wp_set_current_user()' );
	return wp_set_current_user($id, $name);
}