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. Only possible when `$stop` is false,
as the function otherwise exits rather than returning false.
Defined at: - Introduced in WordPress: 2.0.3
- Deprecated in WordPress: —
Description
Verifies the Ajax request to prevent processing requests external of the blog.