Merge pull request #9066 from dominic-p/query-id-check

Check specifically for Post IDs in WC Query verbose rules fix
This commit is contained in:
Mike Jolley 2015-09-07 13:22:29 +01:00
commit 174967dd6b
1 changed files with 1 additions and 1 deletions

View File

@ -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', '' );