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.
3747* the current user.3748*3749* @since 3.9.03750*3751* @param int|false$user_id User IDif one has been determined,false otherwise.3752*/3753$user_id=apply_filters('determine_current_user',false);3754if(!$user_id){3755wp_set_current_user(0);3756return$current_user;3757}37583759wp_set_current_user($user_id);
History
Introduced in 3.9.0. Unchanged from 6.7.7 through 7.1.0.