Ticket #11330: 11330.3.diff
| File 11330.3.diff, 1.2 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 // Look for archive queries. Dates, categories, authors, search, post type archives. 1513 1514 1514 // Look for archive queries. Dates, categories, authors, search, post type archives. 1515 if ( ! empty( $qv['s'] ) || ( $this->is_main_query() && array_key_exists( 's', $this->query ) ) ) 1515 if ( isset( $this->query['s'] ) ) { 1516 1516 $this->is_search = true; 1517 } 1517 1518 1518 1519 if ( '' !== $qv['second'] ) { 1519 1520 $this->is_time = true; … … 2261 2262 } 2262 2263 } 2263 2264 2264 if ( $this->is_search ) {2265 $search = 'AND 0';2266 }2267 2268 2265 if ( $this->is_feed ) { 2269 2266 // This overrides posts_per_page. 2270 2267 if ( ! empty( $q['posts_per_rss'] ) ) { … … 2477 2474 } 2478 2475 2479 2476 // If a search pattern is specified, load the posts that match. 2480 if ( ! empty( $q['s'] ) ) 2477 if ( ! empty( $q['s'] ) ) { 2481 2478 $search = $this->parse_search( $q ); 2479 } elseif ( $this->is_search ) { 2480 $search = 'AND 0'; 2481 } 2482 2482 2483 2483 /** 2484 2484 * Filter the search SQL that is used in the WHERE clause of WP_Query.