I'm interested in writing a caching function for Ajax calls.

If a third party plugin does their thing, calls wp_ajax_whatever, how do I pick that off?

If a person does slideshow updates with a plugin that uses Ajax, e.g. wp_ajax_plugin_update_slider, I want to empty my template cache when this happens. How do I do this?

1 Answer 1


If you check the source for admin-ajax.php you will notice that the admin_init hook fires and that the system checks $_REQUEST['action'] for hooks. Given that, you could hook to admin_init, check the "request" super global, construct wp_ajax_* and wp_ajax_nopriv_* values, then use has_action() to see if anything is hooked in.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.