wp_auth_check() WordPress Function
wp_auth_check() is a Wordpress function that checks if a user is logged in. If a user is logged in, it returns true. If a user is not logged in, it returns false.
wp_auth_check( array $response ) #
Check whether a user is still logged in, for the heartbeat.
Description
Send a result that shows a log-in box if the user is no longer logged in, or if their cookie is within the grace period.
Parameters
- $response
(array)(Required)The Heartbeat response.
Return
(array) The Heartbeat response with 'wp-auth-check' value set.
Source
File: wp-includes/functions.php
function wp_auth_check( $response ) { $response['wp-auth-check'] = is_user_logged_in() && empty( $GLOBALS['login_grace_period'] ); return $response; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.6.0 | Introduced. |