Initialise Search related query vars. Props scribu. Fixes #11480

git-svn-id: https://develop.svn.wordpress.org/trunk@13492 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2010-02-28 07:47:11 +00:00
parent 0cba2f4429
commit 4070e39a15
1 changed files with 3 additions and 1 deletions

View File

@ -1200,6 +1200,8 @@ class WP_Query {
, 'meta_key'
, 'meta_value'
, 'preview'
, 's'
, 'sentence'
);
foreach ($keys as $key) {
@ -1775,7 +1777,7 @@ class WP_Query {
$searchand = ' AND ';
}
$term = esc_sql($q['s']);
if (empty($q['sentence']) && count($q['search_terms']) > 1 && $q['search_terms'][0] != $q['s'] )
if ( empty($q['sentence']) && count($q['search_terms']) > 1 && $q['search_terms'][0] != $q['s'] )
$search .= " OR ($wpdb->posts.post_title LIKE '{$n}{$term}{$n}') OR ($wpdb->posts.post_content LIKE '{$n}{$term}{$n}')";
if ( !empty($search) ) {