Skip to content

Commit 5fb4da7

Browse files
fix: enhance pre_get_posts to exclude feed queries
1 parent c1b93c0 commit 5fb4da7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

inc/Core.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ public function add_editor_styles() {
112112
/**
113113
* Modify the main query before it is executed.
114114
*
115-
* @param \WP_Query $query The WP_Query instance (passed by reference).
115+
* @param \WP_Query $query The WP_Query instance.
116116
*/
117-
public function pre_get_posts( $query ) {
117+
public function pre_get_posts( \WP_Query $query ) {
118118
// Only modify frontend main query.
119-
if ( is_admin() || ! $query->is_main_query() ) {
119+
if ( is_admin() || ! $query->is_main_query() || $query->is_feed() ) {
120120
return;
121121
}
122122

0 commit comments

Comments
 (0)