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 GitHub
parent 0036b4d293
commit 160b3e3ca7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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,
"product-editor-template-system": 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,
"product-editor-template-system": false,
"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 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(),