WordPress action hook · part of WordPress core
check_ajax_referer
A WordPress core action that 13 plugins also fire themselves, running on 2,880+ sites between them.
“This action is documented in wp-includes/pluggable.php.”
How to use check_ajax_referer
It's an action: your callback runs at that point and receives 2 arguments. Nothing needs to be returned.
Add this to your theme's functions.php or a small custom plugin:
add_action( 'check_ajax_referer', function( $action, $result ) {
// Your code runs here.
}, 10, 2 );Argument names come from GD Security Headers's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
This hook is fired by WordPress core too. Official reference on developer.wordpress.org →
13 plugins that fire check_ajax_referer
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
GD Security Headers1,000+ installs
do_action( 'check_ajax_referer', $action, $result )d4plib/d4p.wp.php:341 -
GD Rating System1,000+ installs
do_action( 'check_ajax_referer', $action, $result )d4plib/d4p.wp.php:341 -
GD Mail Queue700+ installs
do_action( 'check_ajax_referer', $action, $result )d4plib/d4p.wp.php:341 -
DemoPress: Demo Content Generator70+ installs
do_action( 'check_ajax_referer', $action, $result )library/dev4press/core/quick/WPR.php:544 -
WP JW Player60+ installs
do_action( 'check_ajax_referer', $action, $result )plugin.php:170 -
Sniplets30+ installs
do_action( 'check_ajax_referer', $action, $result )plugin.php:169 -
Filled In20+ installs
do_action( 'check_ajax_referer', $action, $result )plugin.php:173 -
Alharthiweb 3D Product ViewerFewer than 10 installs
do_action( 'check_ajax_referer', $action, $result )includes/class-commerce.php:79 -
Alharthiweb Phone Country CodeFewer than 10 installs
do_action( 'check_ajax_referer', $action, $result )includes/class-commerce.php:79 -
Alharthiweb Admin OrganizerFewer than 10 installs
do_action( 'check_ajax_referer', $action, $result )includes/class-commerce.php:80 -
PublishPress Cart: eCommerce for Digital Products, Memberships, Downloads, SubscriptionsFewer than 10 installs
do_action( 'check_ajax_referer', $action, $result )includes/functions/ajax-security.php:86 -
vCardigitFewer than 10 installs
do_action( 'check_ajax_referer', $action, $result )includes/class-vcardigit-request-guard.php:68 -
UBB MasterFewer than 10 installs
do_action( 'check_ajax_referer', $action, $result )base/search-plugin.php:170
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.