From 5fc2e8fba9e8090895479091813f8e9968c1482a Mon Sep 17 00:00:00 2001 From: Peter Fabian Date: Fri, 7 Feb 2020 11:06:35 +0100 Subject: [PATCH] Only skip the store_notices during new install in AS. --- includes/admin/class-wc-admin-notices.php | 2 +- includes/class-wc-install.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/admin/class-wc-admin-notices.php b/includes/admin/class-wc-admin-notices.php index a7dfd8cd573..a688a45e930 100644 --- a/includes/admin/class-wc-admin-notices.php +++ b/includes/admin/class-wc-admin-notices.php @@ -49,7 +49,7 @@ class WC_Admin_Notices { add_action( 'switch_theme', array( __CLASS__, 'reset_admin_notices' ) ); add_action( 'woocommerce_installed', array( __CLASS__, 'reset_admin_notices' ) ); add_action( 'wp_loaded', array( __CLASS__, 'hide_notices' ) ); - if ( ! wc_is_running_from_async_action_scheduler() ) { + if ( ! WC_Install::is_new_install() || ! wc_is_running_from_async_action_scheduler() ) { add_action( 'shutdown', array( __CLASS__, 'store_notices' ) ); } diff --git a/includes/class-wc-install.php b/includes/class-wc-install.php index 01309f87ce2..357ae88bd3c 100644 --- a/includes/class-wc-install.php +++ b/includes/class-wc-install.php @@ -319,7 +319,7 @@ class WC_Install { * @since 3.2.0 * @return boolean */ - private static function is_new_install() { + public static function is_new_install() { $product_count = array_sum( (array) wp_count_posts( 'product' ) ); return is_null( get_option( 'woocommerce_version', null ) ) || ( 0 === $product_count && -1 === wc_get_page_id( 'shop' ) );