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 <github-actions@github.com>
This commit is contained in:
Moon 2024-09-16 21:02:21 -07:00 committed by Christopher Allford
parent 2ce234217a
commit 00dcadac4c
No known key found for this signature in database
GPG Key ID: 80E44C778F08A88E
4 changed files with 13 additions and 2 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: add
Add use-wp-horizon feature flag to set calpyso_env to horizon

View File

@ -39,6 +39,7 @@
"launch-your-store": true, "launch-your-store": true,
"product-editor-template-system": false, "product-editor-template-system": false,
"blueprint": false, "blueprint": false,
"reactify-classic-payments-settings": false "reactify-classic-payments-settings": false,
"use-wp-horizon": false
} }
} }

View File

@ -39,6 +39,7 @@
"launch-your-store": true, "launch-your-store": true,
"product-editor-template-system": false, "product-editor-template-system": false,
"blueprint": true, "blueprint": true,
"reactify-classic-payments-settings": false "reactify-classic-payments-settings": false,
"use-wp-horizon": false
} }
} }

View File

@ -11,6 +11,7 @@ defined( 'ABSPATH' ) || exit;
use ActionScheduler; use ActionScheduler;
use Automattic\Jetpack\Connection\Manager; use Automattic\Jetpack\Connection\Manager;
use Automattic\WooCommerce\Admin\Features\Features;
use Automattic\WooCommerce\Admin\PluginsHelper; use Automattic\WooCommerce\Admin\PluginsHelper;
use Automattic\WooCommerce\Admin\PluginsInstallLoggers\AsynPluginsInstallLogger; use Automattic\WooCommerce\Admin\PluginsInstallLoggers\AsynPluginsInstallLogger;
use WC_REST_Data_Controller; use WC_REST_Data_Controller;
@ -238,6 +239,10 @@ class OnboardingPlugins extends WC_REST_Data_Controller {
$redirect_url = $request->get_param( 'redirect_url' ); $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'; $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 [ return [
'success' => ! $errors->has_errors(), 'success' => ! $errors->has_errors(),
'errors' => $errors->get_error_messages(), 'errors' => $errors->get_error_messages(),