From 488eefd7ecda2c44ff0f1d920f1986d9f4ae6e99 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Thu, 18 Jul 2019 23:43:32 -0300 Subject: [PATCH] Don't allow before before_woocommerce_init --- includes/wc-core-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/wc-core-functions.php b/includes/wc-core-functions.php index d1e6c100793..f7899e2f681 100644 --- a/includes/wc-core-functions.php +++ b/includes/wc-core-functions.php @@ -2263,7 +2263,7 @@ function wc_get_server_database_version() { * @return void */ function wc_load_cart() { - if ( ! did_action( 'woocommerce_loaded' ) ) { + if ( ! did_action( 'before_woocommerce_init' ) || doing_action( 'before_woocommerce_init' ) ) { /* translators: 1: wc_get_product 2: woocommerce_init */ wc_doing_it_wrong( __FUNCTION__, sprintf( __( '%1$s should not be called before the %2$s action.', 'woocommerce' ), 'wc_load_cart', 'woocommerce_init' ), '3.7' ); return;