From 4070e39a1509246aa1a3384c6bf5fb7784aff5df Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sun, 28 Feb 2010 07:47:11 +0000 Subject: [PATCH] Initialise Search related query vars. Props scribu. Fixes #11480 git-svn-id: https://develop.svn.wordpress.org/trunk@13492 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/query.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 07e2132ef5..650a1a90e2 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -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) ) {