wp_auth_check

The timeline below displays how wordpress function wp_auth_check has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * 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.
 *
 * @since 3.6.0
 *
 * @global int $login_grace_period
 *
 * @param array $response  The Heartbeat response.
 * @return array The Heartbeat response with 'wp-auth-check' value set.
 */
function wp_auth_check($response)
{
    $response['wp-auth-check'] = is_user_logged_in() && empty($GLOBALS['login_grace_period']);
    return $response;
}

WordPress Version: 5.4

/**
 * 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.
 *
 * @since 3.6.0
 *
 * @global int $login_grace_period
 *
 * @param array $response  The Heartbeat response.
 * @return array The Heartbeat response with 'wp-auth-check' value set.
 */
function wp_auth_check($response)
{
    $response['wp-auth-check'] = is_user_logged_in() && empty($GLOBALS['login_grace_period']);
    return $response;
}

WordPress Version: 4.3

/**
 * 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.
 *
 * @since 3.6.0
 *
 * @global int $login_grace_period
 *
 * @param array $response  The Heartbeat response.
 * @return array $response The Heartbeat response with 'wp-auth-check' value set.
 */
function wp_auth_check($response)
{
    $response['wp-auth-check'] = is_user_logged_in() && empty($GLOBALS['login_grace_period']);
    return $response;
}

WordPress Version: 4.0

/**
 * 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.
 *
 * @since 3.6.0
 *
 * @param array|object $response  The Heartbeat response object or array.
 * @return array|object $response The Heartbeat response object or array with 'wp-auth-check'
 *                                value set.
 */
function wp_auth_check($response)
{
    $response['wp-auth-check'] = is_user_logged_in() && empty($GLOBALS['login_grace_period']);
    return $response;
}

WordPress Version: 3.9

/**
 * 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.
 *
 * @since 3.6.0
 */
function wp_auth_check($response)
{
    $response['wp-auth-check'] = is_user_logged_in() && empty($GLOBALS['login_grace_period']);
    return $response;
}

WordPress Version: 3.7

/**
 * 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.
 *
 * @since 3.6.0
 */
function wp_auth_check($response, $data)
{
    $response['wp-auth-check'] = is_user_logged_in() && empty($GLOBALS['login_grace_period']);
    return $response;
}