check_ajax_referer


check_ajax_referer ( $action = -1, $query_arg = false, $stop = 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) stop Optional. Whether to stop early when the nonce cannot be verified. Default true.
Returns:
  • (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.
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_raw_referer, wp_get_referer, wp_ajax_parse_embed

Top Google Results

User discussions

wpseek mobile