check_admin_referer

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

WordPress Version: 6.3

/**
 * Ensures intent by verifying that a user was referred from another admin page with the correct security nonce.
 *
 * This function ensures the user intends to perform a given action, which helps protect against clickjacking style
 * attacks. It verifies intent, not authorization, therefore it does not verify the user's capabilities. This should
 * be performed with `current_user_can()` or similar.
 *
 * If the nonce value is invalid, the function will exit with an "Are You Sure?" style message.
 *
 * @since 1.2.0
 * @since 2.5.0 The `$query_arg` parameter was added.
 *
 * @param int|string $action    The nonce action.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST`. Default '_wpnonce'.
 * @return int|false 1 if the nonce is valid and generated between 0-12 hours ago,
 *                   2 if the nonce is valid and generated between 12-24 hours ago.
 *                   False if the nonce is invalid.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify an action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && str_starts_with($referer, $adminurl))) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 6.2

/**
 * Ensures intent by verifying that a user was referred from another admin page with the correct security nonce.
 *
 * This function ensures the user intends to perform a given action, which helps protect against clickjacking style
 * attacks. It verifies intent, not authorization, therefore it does not verify the user's capabilities. This should
 * be performed with `current_user_can()` or similar.
 *
 * If the nonce value is invalid, the function will exit with an "Are You Sure?" style message.
 *
 * @since 1.2.0
 * @since 2.5.0 The `$query_arg` parameter was added.
 *
 * @param int|string $action    The nonce action.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST`. Default '_wpnonce'.
 * @return int|false 1 if the nonce is valid and generated between 0-12 hours ago,
 *                   2 if the nonce is valid and generated between 12-24 hours ago.
 *                   False if the nonce is invalid.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify an action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 5.8

/**
 * Ensures intent by verifying that a user was referred from another admin page with the correct security nonce.
 *
 * This function ensures the user intends to perform a given action, which helps protect against clickjacking style
 * attacks. It verifies intent, not authorisation, therefore it does not verify the user's capabilities. This should
 * be performed with `current_user_can()` or similar.
 *
 * If the nonce value is invalid, the function will exit with an "Are You Sure?" style message.
 *
 * @since 1.2.0
 * @since 2.5.0 The `$query_arg` parameter was added.
 *
 * @param int|string $action    The nonce action.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST`. Default '_wpnonce'.
 * @return int|false 1 if the nonce is valid and generated between 0-12 hours ago,
 *                   2 if the nonce is valid and generated between 12-24 hours ago.
 *                   False if the nonce is invalid.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify an action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 5.4

/**
 * Ensures intent by verifying that a user was referred from another admin page with the correct security nonce.
 *
 * This function ensures the user intends to perform a given action, which helps protect against clickjacking style
 * attacks. It verifies intent, not authorisation, therefore it does not verify the user's capabilities. This should
 * be performed with `current_user_can()` or similar.
 *
 * If the nonce value is invalid, the function will exit with an "Are You Sure?" style message.
 *
 * @since 1.2.0
 * @since 2.5.0 The `$query_arg` parameter was added.
 *
 * @param int|string $action    The nonce action.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST`. Default '_wpnonce'.
 * @return int|false 1 if the nonce is valid and generated between 0-12 hours ago,
 *                   2 if the nonce is valid and generated between 12-24 hours ago.
 *                   False if the nonce is invalid.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 5.3

/**
 * Ensures intent by verifying that a user was referred from another admin page with the correct security nonce.
 *
 * This function ensures the user intends to perform a given action, which helps protect against clickjacking style
 * attacks. It verifies intent, not authorisation, therefore it does not verify the user's capabilities. This should
 * be performed with `current_user_can()` or similar.
 *
 * If the nonce value is invalid, the function will exit with an "Are You Sure?" style message.
 *
 * @since 1.2.0
 * @since 2.5.0 The `$query_arg` parameter was added.
 *
 * @param int|string $action    The nonce action.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST`. Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 2.4

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 2.3

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: .20

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 2.2

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: .10

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 5.2

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 1.3

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 1.2

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: .10

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 5.1

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 0.7

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 0.3

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: .20

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 0.2

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: .10

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 9.3

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: .20

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 9.2

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: .12

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 8.2

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: .11

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 6.3

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: .20

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 6.2

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: .16

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 4.6

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 5.4

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: .30

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 5.3

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: .20

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 5.2

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: .19

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 4.4

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: .30

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 4.3

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: .20

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 3.4

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: .30

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 3.3

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: .21

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 4.3

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 2.4

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    return $result;
}

WordPress Version: .30

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 2.3

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    return $result;
}

WordPress Version: .25

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 4.2

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce.
 * @param string     $query_arg Optional. Key to check for nonce in `$_REQUEST` (since 2.5).
 *                              Default '_wpnonce'.
 * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
 *                   0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string    $action The nonce action.
     * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
     *                          0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
     */
    do_action('check_admin_referer', $action, $result);
    return $result;
}

WordPress Version: 1.5

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce
 * @param string     $query_arg Where to look for nonce in $_REQUEST (since 2.5)
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string $action The nonce action.
     * @param bool   $result Whether the admin request nonce was validated.
     */
    do_action('check_admin_referer', $action, $result);
    return $result;
}

WordPress Version: .40

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce
 * @param string     $query_arg Where to look for nonce in $_REQUEST (since 2.5)
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string $action The nonce action.
     * @param bool   $result Whether the admin request nonce was validated.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 1.4

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce
 * @param string     $query_arg Where to look for nonce in $_REQUEST (since 2.5)
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string $action The nonce action.
     * @param bool   $result Whether the admin request nonce was validated.
     */
    do_action('check_admin_referer', $action, $result);
    return $result;
}

WordPress Version: .30

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce
 * @param string     $query_arg Where to look for nonce in $_REQUEST (since 2.5)
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string $action The nonce action.
     * @param bool   $result Whether the admin request nonce was validated.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 1.3

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce
 * @param string     $query_arg Where to look for nonce in $_REQUEST (since 2.5)
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string $action The nonce action.
     * @param bool   $result Whether the admin request nonce was validated.
     */
    do_action('check_admin_referer', $action, $result);
    return $result;
}

WordPress Version: .28

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce
 * @param string     $query_arg Where to look for nonce in $_REQUEST (since 2.5)
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string $action The nonce action.
     * @param bool   $result Whether the admin request nonce was validated.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 4.1

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param int|string $action    Action nonce
 * @param string     $query_arg Where to look for nonce in $_REQUEST (since 2.5)
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string $action The nonce action.
     * @param bool   $result Whether the admin request nonce was validated.
     */
    do_action('check_admin_referer', $action, $result);
    return $result;
}

WordPress Version: 0.4

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param string $action Action nonce
 * @param string $query_arg where to look for nonce in $_REQUEST (since 2.5)
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string $action The nonce action.
     * @param bool   $result Whether the admin request nonce was validated.
     */
    do_action('check_admin_referer', $action, $result);
    return $result;
}

WordPress Version: .30

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param string $action Action nonce
 * @param string $query_arg where to look for nonce in $_REQUEST (since 2.5)
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string $action The nonce action.
     * @param bool   $result Whether the admin request nonce was validated.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 0.3

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param string $action Action nonce
 * @param string $query_arg where to look for nonce in $_REQUEST (since 2.5)
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string $action The nonce action.
     * @param bool   $result Whether the admin request nonce was validated.
     */
    do_action('check_admin_referer', $action, $result);
    return $result;
}

WordPress Version: .28

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param string $action Action nonce
 * @param string $query_arg where to look for nonce in $_REQUEST (since 2.5)
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string $action The nonce action.
     * @param bool   $result Whether the admin request nonce was validated.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 3.9

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 *
 * @param string $action Action nonce
 * @param string $query_arg where to look for nonce in $_REQUEST (since 2.5)
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string $action The nonce action.
     * @param bool   $result Whether the admin request nonce was validated.
     */
    do_action('check_admin_referer', $action, $result);
    return $result;
}

WordPress Version: 8.4

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 * @uses do_action() Calls 'check_admin_referer' on $action.
 *
 * @param string $action Action nonce
 * @param string $query_arg where to look for nonce in $_REQUEST (since 2.5)
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    do_action('check_admin_referer', $action, $result);
    return $result;
}

WordPress Version: .31

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 * @uses do_action() Calls 'check_admin_referer' on $action.
 *
 * @param string $action Action nonce
 * @param string $query_arg where to look for nonce in $_REQUEST (since 2.5)
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string $action The nonce action.
     * @param bool   $result Whether the admin request nonce was validated.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 7.5

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 * @uses do_action() Calls 'check_admin_referer' on $action.
 *
 * @param string $action Action nonce
 * @param string $query_arg where to look for nonce in $_REQUEST (since 2.5)
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    do_action('check_admin_referer', $action, $result);
    return $result;
}

WordPress Version: .40

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 * @uses do_action() Calls 'check_admin_referer' on $action.
 *
 * @param string $action Action nonce
 * @param string $query_arg where to look for nonce in $_REQUEST (since 2.5)
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string $action The nonce action.
     * @param bool   $result Whether the admin request nonce was validated.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 7.4

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 * @uses do_action() Calls 'check_admin_referer' on $action.
 *
 * @param string $action Action nonce
 * @param string $query_arg where to look for nonce in $_REQUEST (since 2.5)
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    do_action('check_admin_referer', $action, $result);
    return $result;
}

WordPress Version: .31

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 * @uses do_action() Calls 'check_admin_referer' on $action.
 *
 * @param string $action Action nonce
 * @param string $query_arg where to look for nonce in $_REQUEST (since 2.5)
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 === $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2.0');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    /**
     * Fires once the admin request has been validated or not.
     *
     * @since 1.5.1
     *
     * @param string $action The nonce action.
     * @param bool   $result Whether the admin request nonce was validated.
     */
    do_action('check_admin_referer', $action, $result);
    if (!$result && !(-1 === $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    return $result;
}

WordPress Version: 3.7

/**
 * Makes sure that a user was referred from another admin page.
 *
 * To avoid security exploits.
 *
 * @since 1.2.0
 * @uses do_action() Calls 'check_admin_referer' on $action.
 *
 * @param string $action Action nonce
 * @param string $query_arg where to look for nonce in $_REQUEST (since 2.5)
 */
function check_admin_referer($action = -1, $query_arg = '_wpnonce')
{
    if (-1 == $action) {
        _doing_it_wrong(__FUNCTION__, __('You should specify a nonce action to be verified by using the first parameter.'), '3.2');
    }
    $adminurl = strtolower(admin_url());
    $referer = strtolower(wp_get_referer());
    $result = isset($_REQUEST[$query_arg]) ? wp_verify_nonce($_REQUEST[$query_arg], $action) : false;
    if (!$result && !(-1 == $action && strpos($referer, $adminurl) === 0)) {
        wp_nonce_ays($action);
        die;
    }
    do_action('check_admin_referer', $action, $result);
    return $result;
}