diff --git a/admin/includes/welcome.php b/admin/includes/welcome.php index bbfc8e649fd..77a026afb8e 100644 --- a/admin/includes/welcome.php +++ b/admin/includes/welcome.php @@ -122,6 +122,10 @@ class WC_Welcome_Page { private function intro() { global $woocommerce; + // Flush rules after update + if ( ! empty( $_GET['wc-updated'] ) ) + flush_rewrite_rules( false ); + // Drop minor version if 0 $major_version = strstr( $woocommerce->version, '0.0' ) ? substr( $woocommerce->version, 0, 3 ) : $woocommerce->version; ?> diff --git a/admin/woocommerce-admin-init.php b/admin/woocommerce-admin-init.php index cdd4bbd2756..453337cf268 100644 --- a/admin/woocommerce-admin-init.php +++ b/admin/woocommerce-admin-init.php @@ -284,9 +284,6 @@ function woocommerce_admin_init() { delete_option( '_wc_install_pages' ); delete_option( '_wc_needs_update' ); - // Flush rules after update - flush_rewrite_rules( false ); - // What's new redirect wp_safe_redirect( admin_url( 'index.php?page=wc-about&wc-updated=true' ) ); exit;