Uma área de pesquisa sobre o WordPress para devs e autores do tema



wp_auth_check ›

Desde3.6.0
Obsoleton/a
wp_auth_check ( $response )
Parâmetros:
  • (array) $response The Heartbeat response.
    Required: Yes
Retorna:
  • (array) $response The Heartbeat response with 'wp-auth-check' value set.
Definido em:
Codex:

Check 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.



Fonte

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