From 95755cb59dd1fa12eb7d7ddef9d09f14a9619113 Mon Sep 17 00:00:00 2001 From: Jonathan Sadowski Date: Wed, 30 Sep 2020 16:00:45 -0500 Subject: [PATCH] Update the activation transient to only get added on new installs --- includes/class-wc-install.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/includes/class-wc-install.php b/includes/class-wc-install.php index 640f3140dca..79d256c5b10 100644 --- a/includes/class-wc-install.php +++ b/includes/class-wc-install.php @@ -308,7 +308,7 @@ class WC_Install { self::maybe_update_db_version(); delete_transient( 'wc_installing' ); - set_transient( '_wc_activation_redirect', 1, 30 ); + self::maybe_enable_setup_wizard(); do_action( 'woocommerce_flush_rewrite_rules' ); do_action( 'woocommerce_installed' ); @@ -404,6 +404,17 @@ class WC_Install { return ! is_null( $current_db_version ) && version_compare( $current_db_version, end( $update_versions ), '<' ); } + /** + * See if we need the setup wizard or not. + * + * @since 4.6.0 + */ + private static function maybe_enable_setup_wizard() { + if ( self::is_new_install() ) { + set_transient( '_wc_activation_redirect', 1, 30 ); + } + } + /** * See if we need to show or run database updates during install. *