determine_current_user WordPress Filter Hook

The determine_current_user hook is used to check if the current user is logged in and if so, return the user's data. This hook is used by the Wordpress core function is_user_logged_in() to determine if the user is logged in. If the user is logged in, the function returns the user's data. Otherwise, it returns false.

apply_filters( 'determine_current_user', int|false $user_id ) #

Filters the current user.


Description

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.


Top ↑

Parameters

$user_id

(int|false)User ID if one has been determined, false otherwise.


Top ↑

Source

File: wp-includes/user.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
3.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More