wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



wp_auth_check › WordPress Function

Depuis3.6.0
Dépréciéen/a
wp_auth_check ( $response )
Paramètres:
  • (array) $response The Heartbeat response.
    Requis: Oui
Retourne:
  • (array) The Heartbeat response with 'wp-auth-check' value set.
Défini(e) dans:
Codex:

Checks whether a user is still logged in, for the heartbeat.

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.


Source

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