Skip to content

Commit

Permalink
add main query check
Browse files Browse the repository at this point in the history
  • Loading branch information
timiwahalahti authored and renintw committed Apr 29, 2024
1 parent 9200d20 commit e168575
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 e168575

Please sign in to comment.