Automattic\WooCommerce\Internal\Caches
ProductCacheController::init
Class initialization, invoked by the DI container.
Метод класса: ProductCacheController{}
Хуков нет.
Возвращает
void. Ничего (null).
Использование
$ProductCacheController = new ProductCacheController(); $ProductCacheController->init( $product_cache ): void;
- $product_cache(ProductCache) (обязательный)
- The product cache instance.
Список изменений
| С версии 10.5.0 | Введена. |
Код ProductCacheController::init() ProductCacheController::init WC 11.2.2
final public function init( ProductCache $product_cache ): void {
$this->product_cache = $product_cache;
// Mark cache group as non-persistent immediately to ensure it's set
// regardless of when this controller is instantiated relative to other hooks.
$this->set_product_cache_group_as_non_persistent();
// Defer feature check to 'init' to avoid triggering translations too early.
add_action( 'init', array( $this, 'on_init' ), 0 );
}