diff --git a/includes/class-wc-query.php b/includes/class-wc-query.php index c263fb3a29d..3ef7d440745 100644 --- a/includes/class-wc-query.php +++ b/includes/class-wc-query.php @@ -212,7 +212,7 @@ class WC_Query { } // Fix for verbose page rules - if ( $GLOBALS['wp_rewrite']->use_verbose_page_rules && isset( $q->queried_object_id ) && $q->queried_object_id === wc_get_page_id('shop') ) { + if ( $GLOBALS['wp_rewrite']->use_verbose_page_rules && isset( $q->queried_object->ID ) && $q->queried_object->ID === wc_get_page_id('shop') ) { $q->set( 'post_type', 'product' ); $q->set( 'page', '' ); $q->set( 'pagename', '' );