-
Notifications
You must be signed in to change notification settings - Fork 6
Feature/implement irving is main query #272
base: main
Are you sure you want to change the base?
Conversation
@@ -349,6 +359,7 @@ public function build_query() { | |||
// This ensures we always parse the query so is_home and other flags | |||
// get properly set before we handle template. | |||
if ( empty( $query ) ) { | |||
$wp_query->query( $query ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joemcgill, I think we should consider adding this call to query()
.
If $query
is empty in the constructor, then query()
never runs, which means get_posts()
doesn't run, which means the pre_get_posts
hook never runs.
Which means, pre_get_posts
never runs on the index/home/front-page query, because $query
is an empty string.
Looking for a gut-check from you if this makes sense, or there's something I'm not seeing here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that makes sense, though I'm curious what happens on a traditional home page load. I assume we are needing to work around this because normally on a home page load the query args would not be empty.
If we add this call to query()
here we should be able to remove the parse_query()
call below, since WP_Query::query()
calls WP_Query::get_posts()
, which calls WP_Query::parse_query()
under the hood (see code).
No description provided.