From 66e8525d890a10e8ba600cde9a7211d83e955dc1 Mon Sep 17 00:00:00 2001 From: Joshua T Flowers Date: Mon, 23 Mar 2020 22:07:43 +0200 Subject: [PATCH] Add WooCommerce support if store is using default theme (https://github.com/woocommerce/woocommerce-admin/pull/3908) * Add WooCommerce support if store is using default theme * Check if wc_is_wp_default_theme_active exists before calling it --- plugins/woocommerce-admin/src/Features/Onboarding.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/woocommerce-admin/src/Features/Onboarding.php b/plugins/woocommerce-admin/src/Features/Onboarding.php index f9aabf4ee80..2d453e0747c 100644 --- a/plugins/woocommerce-admin/src/Features/Onboarding.php +++ b/plugins/woocommerce-admin/src/Features/Onboarding.php @@ -309,6 +309,11 @@ class Onboarding { $themes[ $slug ] = $theme_data; } + // Add the WooCommerce support tag for default themes that don't explicitly declare support. + if ( function_exists( 'wc_is_wp_default_theme_active' ) && wc_is_wp_default_theme_active() ) { + $themes[ $active_theme ]['has_woocommerce_support'] = true; + } + $themes = array( $active_theme => $themes[ $active_theme ] ) + $themes; set_transient( self::THEMES_TRANSIENT, $themes, DAY_IN_SECONDS );