wc_is_running_from_async_action_scheduler()WC 4.0.0

Test whether the context of execution comes from async action scheduler.

No Hooks.

Return

true|false.

Usage

wc_is_running_from_async_action_scheduler();

Changelog

Since 4.0.0 Introduced.

wc_is_running_from_async_action_scheduler() code WC 8.6.1

function wc_is_running_from_async_action_scheduler() {
	// phpcs:ignore WordPress.Security.NonceVerification.Recommended
	return isset( $_REQUEST['action'] ) && 'as_async_request_queue_runner' === $_REQUEST['action'];
}