Don't allow before before_woocommerce_init

This commit is contained in:
Claudio Sanches 2019-07-18 23:43:32 -03:00
parent fd42c439f9
commit 488eefd7ec
1 changed files with 1 additions and 1 deletions

View File

@ -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;