From afc2344f47041000234130d82bd2a5714c1409ee Mon Sep 17 00:00:00 2001 From: Nima Karimi <73110514+nima-karimi@users.noreply.github.com> Date: Thu, 30 Mar 2023 14:13:57 +0100 Subject: [PATCH] Remove the MCM feature flag on update to WooCommerce 7.7 (#37454) * Remove the MCM feature flag on update to WooCommerce 7.7 This feature flag is no longer needed because the new marketing page will be the default on version 7.7 (pe2C5g-Ft-p2#comment-582). * Remove the marketing overview welcome option --- .../woocommerce/changelog/feature-remove-mcm-flag-option | 4 ++++ plugins/woocommerce/includes/class-wc-install.php | 3 +++ plugins/woocommerce/includes/wc-update-functions.php | 8 ++++++++ 3 files changed, 15 insertions(+) create mode 100644 plugins/woocommerce/changelog/feature-remove-mcm-flag-option diff --git a/plugins/woocommerce/changelog/feature-remove-mcm-flag-option b/plugins/woocommerce/changelog/feature-remove-mcm-flag-option new file mode 100644 index 00000000000..caa01e7e98b --- /dev/null +++ b/plugins/woocommerce/changelog/feature-remove-mcm-flag-option @@ -0,0 +1,4 @@ +Significance: minor +Type: tweak + +Remove the multichannel marketing feature flag from database since it's the default option now. diff --git a/plugins/woocommerce/includes/class-wc-install.php b/plugins/woocommerce/includes/class-wc-install.php index 33e21419f48..f2c1f4286bc 100644 --- a/plugins/woocommerce/includes/class-wc-install.php +++ b/plugins/woocommerce/includes/class-wc-install.php @@ -229,6 +229,9 @@ class WC_Install { 'wc_update_750_add_columns_to_order_stats_table', 'wc_update_750_disable_new_product_management_experience', ), + '7.7.0' => array( + 'wc_update_770_remove_multichannel_marketing_feature_options', + ), ); /** diff --git a/plugins/woocommerce/includes/wc-update-functions.php b/plugins/woocommerce/includes/wc-update-functions.php index 7c9020db0c7..d70a4233816 100644 --- a/plugins/woocommerce/includes/wc-update-functions.php +++ b/plugins/woocommerce/includes/wc-update-functions.php @@ -2581,3 +2581,11 @@ function wc_update_750_disable_new_product_management_experience() { update_option( 'woocommerce_new_product_management_enabled', 'no' ); } } + +/** + * Remove the multichannel marketing feature flag and options. This feature is now enabled by default. + */ +function wc_update_770_remove_multichannel_marketing_feature_options() { + delete_option( 'woocommerce_multichannel_marketing_enabled' ); + delete_option( 'woocommerce_marketing_overview_welcome_hidden' ); +}