This page redirects to an external site: https://developer.wordpress.org/reference/functions/set_current_user/
Languages: English • 日本語 (Add your language)
This function can be replaced via plugins. If plugins do not redefine these functions, then this will be used 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.
<?php set_current_user( $id, $name ) ?>
set_current_user() is located in wp-includes/pluggable-deprecated.php. Before deprecation it was located in wp-includes/pluggable.php.
Current User Functions: get_current_user_id(), get_currentuserinfo(), wp_get_current_user(), wp_set_current_user(), current_user_can(), current_user_can_for_blog()