Update the activation transient to only get added on new installs

This commit is contained in:
Jonathan Sadowski 2020-09-30 16:00:45 -05:00
parent d245a60c6e
commit 95755cb59d
1 changed files with 12 additions and 1 deletions

View File

@ -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.
*