WC_Install::enable_product_instance_caching_for_newly_installed
Enable product object caching by default for new shops.
Only newly installed stores get the feature enabled here; existing installs keep the opt-in default so their behavior is unchanged on upgrade.
Method of the class: WC_Install{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = WC_Install::enable_product_instance_caching_for_newly_installed(): void;
Changelog
| Since 11.0.0 | Introduced. |
WC_Install::enable_product_instance_caching_for_newly_installed() WC Install::enable product instance caching for newly installed code WC 11.0.1
public static function enable_product_instance_caching_for_newly_installed(): void {
$feature_controller = wc_get_container()->get( FeaturesController::class );
$feature_controller->change_feature_enable( ProductCacheController::FEATURE_NAME, true );
}