wp_doing_ajax

Determines whether the current request is a WordPress Ajax request.

Description

wp_doing_ajax(); 

Usage

  1. if ( !function_exists( 'wp_doing_ajax' ) ) { 
  2. require_once ABSPATH . WPINC . '/load.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_doing_ajax(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/load.php  
  1. function wp_doing_ajax() { 
  2. /** 
  3. * Filters whether the current request is a WordPress Ajax request. 
  4. * @since 4.7.0 
  5. * @param bool $wp_doing_ajax Whether the current request is a WordPress Ajax request. 
  6. */ 
  7. return apply_filters( 'wp_doing_ajax', defined( 'DOING_AJAX' ) && DOING_AJAX );