Clear the theme cache for any plugin update
The cached theme data has some properties that depend on WooCommerce. This could also extend to extensions. Since we don't have a reliable way to know if a given plugin is a WooCommerce extension, any plugin update should flush the cache.
This commit is contained in:
parent
43579aeac9
commit
01fc3018d0
|
@ -50,15 +50,9 @@ class WC_REST_System_Status_V2_Controller extends WC_REST_Controller {
|
|||
}
|
||||
|
||||
// Clear the cache if woocommerce is updated
|
||||
if ( 'plugin' === $extra['type'] && isset( $extra['plugins'] ) ) {
|
||||
$plugins = array_filter( $extra['plugins'], function( $plugin ) {
|
||||
return strpos( $plugin, 'woocommerce.php' ) !== false;
|
||||
} );
|
||||
|
||||
if ( count( $plugins ) > 0 ) {
|
||||
\WC_REST_System_Status_V2_Controller::clean_theme_cache();
|
||||
return;
|
||||
}
|
||||
if ( 'plugin' === $extra['type'] ) {
|
||||
\WC_REST_System_Status_V2_Controller::clean_theme_cache();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( 'theme' === $extra['type'] ) {
|
||||
|
|
Loading…
Reference in New Issue