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.


Top ↑

Parameters

$response

(array)(Required)The Heartbeat response.


Top ↑

Return

(array) The Heartbeat response with 'wp-auth-check' value set.


Top ↑

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;
}


Top ↑

Changelog

Changelog
VersionDescription
3.6.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