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.
3780* the current user.3781*3782* @since 3.9.03783*3784* @param int|false$user_id User IDif one has been determined,false otherwise.3785*/3786$user_id=apply_filters('determine_current_user',false);3787if(!$user_id){3788wp_set_current_user(0);3789return$current_user;3790}37913792wp_set_current_user($user_id);
History
Introduced in 3.9.0. Unchanged from 6.7.7 through 7.1.0.