Only skip the store_notices during new install in AS.
This commit is contained in:
parent
4c4f9f1164
commit
5fc2e8fba9
|
@ -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' ) );
|
||||
}
|
||||
|
||||
|
|
|
@ -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' ) );
|
||||
|
|
Loading…
Reference in New Issue