From 358336546efe2257d0ba39dde7f574cc39e6d3c7 Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 7 Sep 2015 02:17:01 -0700 Subject: [PATCH] Check specifically for Post IDs in WC Query The `WP_Query::queried_object_id` property can reference either a post or a term ID. This way, we ensure that we are check for posts only. --- includes/class-wc-query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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', '' );