WordPress开发者和主题制作者的搜索引擎



wp_auth_check ›

Since3.6.0
已弃用n/a
wp_auth_check ( $response )
参数:
  • (array) $response The Heartbeat response.
    Required: Yes
返回:
  • (array) $response The Heartbeat response with 'wp-auth-check' value set.
定义在:
文档:

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.



源码

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