What is the `wp_doing_ajax()` function used for?

WordPress Expert Easy

WordPress Expert — Easy

What is the `wp_doing_ajax()` function used for?

Key points

  • `wp_doing_ajax()` verifies if the current request is an AJAX request in WordPress.
  • It is not used to initiate AJAX requests from PHP.
  • The function does not return the AJAX action name being processed.
  • It does not check if the AJAX response was sent successfully.

Ready to go further?

Related questions