Ticket #11330: 11330.2.diff
| File 11330.2.diff, 1.3 KB (added by , 12 years ago) |
|---|
-
src/wp-includes/query.php
1510 1510 $this->is_page = true; 1511 1511 $this->is_single = false; 1512 1512 } else { 1513 1513 1514 // Look for archive queries. Dates, categories, authors, search, post type archives. 1514 1515 if ( !empty($qv['s']) ) { 1515 if ( ! empty( $qv['s'] ) || ( $this->is_main_query() && array_key_exists( 's', $this->query ) ) ) 1516 1516 $this->is_search = true; 1517 }1518 1517 1519 1518 if ( '' !== $qv['second'] ) { 1520 1519 $this->is_time = true; … … 2264 2263 $q['nopaging'] = false; 2265 2264 } 2266 2265 } 2266 2267 if ( $this->is_search ) { 2268 $search = 'AND 0'; 2269 } 2270 2267 2271 if ( $this->is_feed ) { 2268 2272 // This overrides posts_per_page. 2269 2273 if ( ! empty( $q['posts_per_rss'] ) ) { … … 2879 2883 } 2880 2884 2881 2885 // Comments feeds 2882 if ( $this->is_comment_feed && ( $this->is_archive || $this->is_search|| !$this->is_singular ) ) {2886 if ( $this->is_comment_feed && ( $this->is_archive || ( $this->is_search && ! empty( $q['s'] ) ) || !$this->is_singular ) ) { 2883 2887 if ( $this->is_archive || $this->is_search ) { 2884 2888 $cjoin = "JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) $join "; 2885 2889 $cwhere = "WHERE comment_approved = '1' $where";