Automattic\WooCommerce\Internal\Caches

ProductVersionStringInvalidator::initpublicWC 10.5.0

Initialize the invalidator and register hooks.

Hooks are only registered when both conditions are met:

  • The REST API caching feature is enabled
  • The backend caching setting is active

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

Хуков нет.

Возвращает

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

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

$ProductVersionStringInvalidator = new ProductVersionStringInvalidator();
$ProductVersionStringInvalidator->init(): void;

Список изменений

С версии 10.5.0 Введена.

Код ProductVersionStringInvalidator::init() WC 10.5.2

final public function init(): void {
	// We can't use FeaturesController::feature_is_enabled at this point
	// (before the 'init' action is triggered) because that would cause
	// "Translation loading for the woocommerce domain was triggered too early" warnings.
	if ( 'yes' !== get_option( 'woocommerce_feature_rest_api_caching_enabled' ) ) {
		return;
	}

	if ( 'yes' === get_option( 'woocommerce_rest_api_enable_backend_caching', 'no' ) ) {
		$this->register_hooks();
	}
}