Automattic\WooCommerce\Caches
ProductCountCacheService::init
Class initialization, invoked by the DI container.
Method of the class: ProductCountCacheService{}
No Hooks.
Returns
null. Nothing (null).
Usage
$ProductCountCacheService = new ProductCountCacheService(); $ProductCountCacheService->init(): void;
ProductCountCacheService::init() ProductCountCacheService::init code WC 11.0.1
final public function init(): void {
$this->product_count_cache = new ProductCountCache();
add_action( 'action_scheduler_ensure_recurring_actions', array( $this, 'unschedule_background_actions' ) );
add_action( self::BACKGROUND_EVENT_HOOK, array( $this, 'prime_cache_if_cold' ) );
if ( defined( 'WC_PLUGIN_BASENAME' ) ) {
add_action( 'deactivate_' . WC_PLUGIN_BASENAME, array( $this, 'unschedule_background_actions' ) );
}
// Until persistent counters reactivated, disable callbacks for woocommerce_new_product, transition_post_status, before_delete_post hooks.
}