Automattic\WooCommerce\Internal\BatchProcessing

BatchProcessingController::has_scheduled_action │ private │ WC 1.0

Check for a pending or in-progress action, falling back to as_next_scheduled_action on Action Scheduler < 3.3.0. Returns false if Action Scheduler is not loaded at all.

Метод класса: BatchProcessingController{}

Хуков нет.

Возвращает

bool. True if a matching action is scheduled.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->has_scheduled_action( $hook, ?array $args ): bool;
$hook(строка) (обязательный)
The hook of the action.
?array $args
.
По умолчанию: null

Код BatchProcessingController::has_scheduled_action() WC 11.2.2

private function has_scheduled_action( string $hook, ?array $args = null ): bool {
	foreach ( $this->scheduled_action_lookups as $function ) {
		if ( function_exists( $function ) ) {
			// `as_next_scheduled_action` returns a timestamp, or true for an in-progress action.
			return (bool) $function( $hook, $args );
		}
	}

	wc_doing_it_wrong( __METHOD__, 'Action Scheduler is not loaded, so scheduled actions cannot be checked.', '11.2.0' );
	return false;
}