Automattic\WooCommerce\Caches

OrderCountCacheService::schedule_background_actionspublicWC 1.0

Register background caching for each order type.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$OrderCountCacheService = new OrderCountCacheService();
$OrderCountCacheService->schedule_background_actions();

Код OrderCountCacheService::schedule_background_actions() WC 11.0.1

public function schedule_background_actions() {
	$order_types = wc_get_order_types( 'order-count' );
	$frequency   = HOUR_IN_SECONDS * 12;
	$timestamp   = time() + $frequency;
	foreach ( $order_types as $order_type ) {
		as_schedule_recurring_action( $timestamp, $frequency, self::BACKGROUND_EVENT_HOOK, array( $order_type ), 'count', true );
	}
}