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.


Top ↑

Source

File: wp-includes/pluggable.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More