WordPress.org

Make WordPress Core

Changeset 28623


Ignore:
Timestamp:
05/29/2014 08:49:28 PM (6 years ago)
Author:
wonderboymusic
Message:

Simplify the logic for determining isset( $this->query['s'] ) after [28612], and don't limit this logic to just the main query.

Props SergeyBiryukov.
Fixes #11330.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/query.php

    r28622 r28623  
    15111511            $this->is_single = false;
    15121512        } else {
    1513 
    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 ) ) )
     1513            // Look for archive queries. Dates, categories, authors, search, post type archives.
     1514
     1515            if ( isset( $this->query['s'] ) ) {
    15161516                $this->is_search = true;
     1517            }
    15171518
    15181519            if ( '' !== $qv['second'] ) {
     
    22622263        }
    22632264
    2264         if ( $this->is_search ) {
    2265             $search = 'AND 0';
    2266         }
    2267 
    22682265        if ( $this->is_feed ) {
    22692266            // This overrides posts_per_page.
     
    24782475
    24792476        // If a search pattern is specified, load the posts that match.
    2480         if ( ! empty( $q['s'] ) )
     2477        if ( ! empty( $q['s'] ) ) {
    24812478            $search = $this->parse_search( $q );
     2479        } elseif ( $this->is_search ) {
     2480            $search = 'AND 0';
     2481        }
    24822482
    24832483        /**
Note: See TracChangeset for help on using the changeset viewer.