Automattic\WooCommerce\Internal\Features
FeaturesController::maybe_invalidate_cached_plugin_data
If the 'incompatible with features' plugin list is being rendered, invalidate existing cached plugin data.
This heads off a problem in which WordPress's get_plugins() may be called much earlier in the request (by third party code, for example), the results of which are cached, and before WooCommerce can modify the list to inject useful information of its own.
Метод класса: FeaturesController{}
Хуков нет.
Возвращает
void. Ничего (null).
Использование
$FeaturesController = new FeaturesController(); $FeaturesController->maybe_invalidate_cached_plugin_data(): void;
Заметки
| Смотрите: https://github.com/woocommerce/woocommerce/issues/37343 |
Код FeaturesController::maybe_invalidate_cached_plugin_data() FeaturesController::maybe invalidate cached plugin data WC 11.3.0
public function maybe_invalidate_cached_plugin_data(): void {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
if ( ( $_GET['plugin_status'] ?? '' ) === 'incompatible_with_feature' ) {
wp_cache_delete( 'plugins', 'plugins' );
}
}