check_ajax_referer


check_ajax_referer ( $action = -1, $query_arg = false, $die = true )

Parameters:
  • (int|string) $action Action nonce.
  • (false|string) $query_arg Optional. Key to check for the nonce in `$_REQUEST` (since 2.5). If false, `$_REQUEST` values will be evaluated for '_ajax_nonce', and '_wpnonce' (in that order). Default false.
  • (bool) $die Optional. Whether to die early when the nonce cannot be verified. Default true.
Returns:
  • (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.
Defined at:

Description

Verifies the Ajax request to prevent processing requests external of the blog.

Related Functions

check_admin_referer, check_password_reset_key, wp_get_referer, wp_get_raw_referer, wp_ajax_parse_embed

Top Google Results

User discussions

wpseek mobile