From 160b3e3ca710fc8487ed603d6fc8fc6f9516bf62 Mon Sep 17 00:00:00 2001 From: Moon Date: Mon, 16 Sep 2024 21:02:21 -0700 Subject: [PATCH] Add use-wp-horizon feature flag (#51421) * Add use-wp-horizon feature flag * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions --- plugins/woocommerce/changelog/51421-update-use-horizon-env | 4 ++++ plugins/woocommerce/client/admin/config/core.json | 3 ++- plugins/woocommerce/client/admin/config/development.json | 3 ++- plugins/woocommerce/src/Admin/API/OnboardingPlugins.php | 5 +++++ 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 plugins/woocommerce/changelog/51421-update-use-horizon-env diff --git a/plugins/woocommerce/changelog/51421-update-use-horizon-env b/plugins/woocommerce/changelog/51421-update-use-horizon-env new file mode 100644 index 00000000000..0258515d62b --- /dev/null +++ b/plugins/woocommerce/changelog/51421-update-use-horizon-env @@ -0,0 +1,4 @@ +Significance: minor +Type: add + +Add use-wp-horizon feature flag to set calpyso_env to horizon \ No newline at end of file diff --git a/plugins/woocommerce/client/admin/config/core.json b/plugins/woocommerce/client/admin/config/core.json index 3c201f07922..6bfd9954259 100644 --- a/plugins/woocommerce/client/admin/config/core.json +++ b/plugins/woocommerce/client/admin/config/core.json @@ -39,6 +39,7 @@ "launch-your-store": true, "product-editor-template-system": false, "blueprint": false, - "reactify-classic-payments-settings": false + "reactify-classic-payments-settings": false, + "use-wp-horizon": false } } diff --git a/plugins/woocommerce/client/admin/config/development.json b/plugins/woocommerce/client/admin/config/development.json index 802c62fe6a3..da6f07d82dd 100644 --- a/plugins/woocommerce/client/admin/config/development.json +++ b/plugins/woocommerce/client/admin/config/development.json @@ -39,6 +39,7 @@ "launch-your-store": true, "product-editor-template-system": false, "blueprint": true, - "reactify-classic-payments-settings": false + "reactify-classic-payments-settings": false, + "use-wp-horizon": false } } diff --git a/plugins/woocommerce/src/Admin/API/OnboardingPlugins.php b/plugins/woocommerce/src/Admin/API/OnboardingPlugins.php index fb6fa25570d..55f55edfe85 100644 --- a/plugins/woocommerce/src/Admin/API/OnboardingPlugins.php +++ b/plugins/woocommerce/src/Admin/API/OnboardingPlugins.php @@ -11,6 +11,7 @@ defined( 'ABSPATH' ) || exit; use ActionScheduler; use Automattic\Jetpack\Connection\Manager; +use Automattic\WooCommerce\Admin\Features\Features; use Automattic\WooCommerce\Admin\PluginsHelper; use Automattic\WooCommerce\Admin\PluginsInstallLoggers\AsynPluginsInstallLogger; use WC_REST_Data_Controller; @@ -238,6 +239,10 @@ class OnboardingPlugins extends WC_REST_Data_Controller { $redirect_url = $request->get_param( 'redirect_url' ); $calypso_env = defined( 'WOOCOMMERCE_CALYPSO_ENVIRONMENT' ) && in_array( WOOCOMMERCE_CALYPSO_ENVIRONMENT, [ 'development', 'wpcalypso', 'horizon', 'stage' ], true ) ? WOOCOMMERCE_CALYPSO_ENVIRONMENT : 'production'; + if ( Features::is_enabled( 'use-wp-horizon' ) ) { + $calypso_env = 'horizon'; + } + return [ 'success' => ! $errors->has_errors(), 'errors' => $errors->get_error_messages(),