Move the LYS feature flag check inside add_lys_default_values() (#46154)

* Move the feature flag check to add_lys_default_values method

* Add changelog

* Revert changes

* Fix bug in login functionality
This commit is contained in:
Chi-Hsuan Huang 2024-04-05 09:20:17 +08:00 committed by GitHub
parent 90c082aafb
commit 4c3d6ffa6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 6 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Move the feature flag check to add_lys_default_values method

View File

@ -254,11 +254,8 @@ final class WooCommerce {
add_action( 'woocommerce_updated', array( $this, 'add_woocommerce_inbox_variant' ) );
add_action( 'woocommerce_installed', array( $this, 'add_woocommerce_remote_variant' ) );
add_action( 'woocommerce_updated', array( $this, 'add_woocommerce_remote_variant' ) );
if ( Features::is_enabled( 'launch-your-store' ) ) {
add_action( 'woocommerce_newly_installed', array( $this, 'add_lys_default_values' ) );
add_action( 'woocommerce_updated', array( $this, 'add_lys_default_values' ) );
}
add_action( 'woocommerce_newly_installed', array( $this, 'add_lys_default_values' ) );
add_action( 'woocommerce_updated', array( $this, 'add_lys_default_values' ) );
// These classes set up hooks on instantiation.
$container = wc_get_container();
@ -318,6 +315,10 @@ final class WooCommerce {
* Set default option values for launch your store task.
*/
public function add_lys_default_values() {
if ( ! Features::is_enabled( 'launch-your-store' ) ) {
return;
}
$is_new_install = current_action() === 'woocommerce_newly_installed';
$coming_soon = $is_new_install ? 'yes' : 'no';
@ -431,7 +432,6 @@ final class WooCommerce {
* The SSR in the name is preserved for bw compatibility, as this was initially used in System Status Report.
*/
$this->define( 'WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE', 'none' );
}
/**