WP_REST_Server::is_dispatching()publicWP 6.5.0

Returns whether the REST server is currently dispatching / responding to a request.

This may be a standalone REST API request, or an internal request dispatched from within a regular page load.

Method of the class: WP_REST_Server{}

No Hooks.

Return

true|false. Whether the REST server is currently handling a request.

Usage

$WP_REST_Server = new WP_REST_Server();
$WP_REST_Server->is_dispatching();

Changelog

Since 6.5.0 Introduced.

WP_REST_Server::is_dispatching() code WP 6.8

public function is_dispatching() {
	return (bool) $this->dispatching_requests;
}