wp_auth_check( array $response ): array

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. View all references

function wp_auth_check( $response ) {
	$response['wp-auth-check'] = is_user_logged_in() && empty( $GLOBALS['login_grace_period'] );
	return $response;
}


Top ↑

Changelog

Changelog
Version Description
3.6.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.