Automattic\WooCommerce\Internal\Admin\Onboarding

OnboardingSetupWizard::is_running_from_async_action_scheduler()privateWC 1.0

Test whether the context of execution comes from async action scheduler. Note: this is a polyfill for wc_is_running_from_async_action_scheduler() which was introduced in WC 4.0.

{} It's a method of the class: OnboardingSetupWizard{}

No Hooks.

Return

true|false.

Usage

// private - for code of main (parent) class only
$result = $this->is_running_from_async_action_scheduler();

Code of OnboardingSetupWizard::is_running_from_async_action_scheduler() WC 7.1.0

private function is_running_from_async_action_scheduler() {
	if ( function_exists( '\wc_is_running_from_async_action_scheduler' ) ) {
		return \wc_is_running_from_async_action_scheduler();
	}

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