Fixed WooCommerce writes current_theme_supports_woocommerce option on every page view.

This commit is contained in:
Daniel Kudwien 2019-03-14 20:09:43 +01:00
parent 4f14637514
commit 7702f773b9
1 changed files with 2 additions and 1 deletions

View File

@ -295,7 +295,8 @@ class WC_Post_Types {
}
// If theme support changes, we may need to flush permalinks since some are changed based on this flag.
if ( update_option( 'current_theme_supports_woocommerce', current_theme_supports( 'woocommerce' ) ? 'yes' : 'no' ) ) {
$theme_support = current_theme_supports( 'woocommerce' ) ? 'yes' : 'no';
if ( $theme_support !== get_option('current_theme_supports_woocommerce') && update_option( 'current_theme_supports_woocommerce', $theme_support ) ) {
update_option( 'woocommerce_queue_flush_rewrite_rules', 'yes' );
}