check_ajax_referer WordPress Action Hook
The check_ajax_referer hook is used to verify that an AJAX request was made with a valid nonce. This hook is important for security because it helps to prevent CSRF attacks.
do_action( 'check_ajax_referer', string $action , false|int $result ) #
Fires once the Ajax request has been validated or not.
Parameters
- $action
(string)The Ajax nonce action.
- $result
(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.
Source
Changelog
Version | Description |
---|---|
2.1.0 | Introduced. |