Filter hook 'wp_doing_ajax'

in WP Core File wp-includes/load.php at line 1749

View Source

wp_doing_ajax

Filter Hook
Description
Filters whether the current request is a WordPress Ajax request.

Hook Information

File Location wp-includes/load.php View on GitHub
Hook Type Filter
Line Number 1749

Hook Parameters

Type Name Description
bool $wp_doing_ajax Whether the current request is a WordPress Ajax request.

Usage Examples

Basic Usage
<?php
// Hook into wp_doing_ajax
add_filter('wp_doing_ajax', 'my_custom_filter', 10, 1);

function my_custom_filter($wp_doing_ajax) {
    // Your custom filtering logic here
    return $wp_doing_ajax;
}

Source Code Context

wp-includes/load.php:1749 - How this hook is used in WordPress core
<?php
1744  	 *
1745  	 * @since 4.7.0
1746  	 *
1747  	 * @param bool $wp_doing_ajax Whether the current request is a WordPress Ajax request.
1748  	 */
1749  	return apply_filters( 'wp_doing_ajax', defined( 'DOING_AJAX' ) && DOING_AJAX );
1750  }
1751  
1752  /**
1753   * Determines whether the current request should use themes.
1754   *

PHP Documentation

<?php
/**
	 * Filters whether the current request is a WordPress Ajax request.
	 *
	 * @since 4.7.0
	 *
	 * @param bool $wp_doing_ajax Whether the current request is a WordPress Ajax request.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/load.php
Related Hooks

Related hooks will be displayed here in future updates.