The default filters use this to determine the current user from the request's cookies, if available. Returning a value of false will effectively short-circuit setting the current user.
Parameters
$user_idint|false
User ID if one has been determined, false otherwise.
3820* the current user.3821*3822* @since 3.9.03823*3824* @param int|false$user_id User IDif one has been determined,false otherwise.3825*/3826$user_id=apply_filters('determine_current_user',false);3827if(!$user_id){3828wp_set_current_user(0);3829return$current_user;3830}38313832wp_set_current_user($user_id);
History
Introduced in 3.9.0. Unchanged from 6.7.7 through 7.1.0.