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:

functions.php
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.

  1. GD Security Headers icon GD Security Headers1,000+ installs do_action( 'check_ajax_referer', $action, $result ) d4plib/d4p.wp.php:341
  2. GD Rating System icon GD Rating System1,000+ installs do_action( 'check_ajax_referer', $action, $result ) d4plib/d4p.wp.php:341
  3. GD Mail Queue icon GD Mail Queue700+ installs do_action( 'check_ajax_referer', $action, $result ) d4plib/d4p.wp.php:341
  4. DemoPress: Demo Content Generator icon DemoPress: Demo Content Generator70+ installs do_action( 'check_ajax_referer', $action, $result ) library/dev4press/core/quick/WPR.php:544
  5. WP JW Player icon WP JW Player60+ installs do_action( 'check_ajax_referer', $action, $result ) plugin.php:170
  6. Sniplets icon Sniplets30+ installs do_action( 'check_ajax_referer', $action, $result ) plugin.php:169
  7. Filled In icon Filled In20+ installs do_action( 'check_ajax_referer', $action, $result ) plugin.php:173
  8. Alharthiweb 3D Product Viewer icon Alharthiweb 3D Product ViewerFewer than 10 installs do_action( 'check_ajax_referer', $action, $result ) includes/class-commerce.php:79
  9. Alharthiweb Phone Country Code icon Alharthiweb Phone Country CodeFewer than 10 installs do_action( 'check_ajax_referer', $action, $result ) includes/class-commerce.php:79
  10. Alharthiweb Admin Organizer icon Alharthiweb Admin OrganizerFewer than 10 installs do_action( 'check_ajax_referer', $action, $result ) includes/class-commerce.php:80
  11. PublishPress Cart: eCommerce for Digital Products, Memberships, Downloads, Subscriptions icon 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
  12. vCardigit icon vCardigitFewer than 10 installs do_action( 'check_ajax_referer', $action, $result ) includes/class-vcardigit-request-guard.php:68
  13. UBB Master icon 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.