WordPress at a glance

wp_doing_ajax() WP 1.0

Determines whether the current request is a WordPress Ajax request.

✈ 1 time = 0.000007s = speed of light | 50000 times = 0.01s = speed of light PHP 7.0.8, WP 4.7
Hooks from function:
Return

true/false. True if it's a WordPress Ajax request, false otherwise.

Usage

wp_doing_ajax();

Code of wp_doing_ajax: wp-includes/load.php VER 4.9.8

<?php
function wp_doing_ajax() {
	/**
	 * 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.
	 */
	return apply_filters( 'wp_doing_ajax', defined( 'DOING_AJAX' ) && DOING_AJAX );
}

Related Functions

From tag: AJAX

More from tag: Conditional tags (page type and request)

More from tag: Conditional tags (all)

More from category: Helper Functions

No comments
    Hello, !     Log In . Register