Skip to content

Commit

Permalink
add main query check
Browse files Browse the repository at this point in the history
  • Loading branch information
timiwahalahti committed Jul 21, 2023
1 parent 6fc0980 commit e21195d
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ public function query_public_statuses( $query ) {
return;
}

if ( ! $query->is_main_query() ) {
return;
}

// Bail if post type is something other than WordCamp.
// is_singular check breaks the frontpage so let's do it this way.
if ( ! $query->is_post_type_archive( WCPT_POST_TYPE_ID ) && ! ( isset( $query->query_vars['post_type'] ) && WCPT_POST_TYPE_ID === $query->query_vars['post_type'] ) ) {
return;
}
Expand Down

0 comments on commit e21195d

Please sign in to comment.