Ticket #39717: search_terms_count.patch
File search_terms_count.patch, 799 bytes (added by , 8 years ago) |
---|
-
src/wp-includes/class-wp-query.php
1309 1309 $q['search_terms'] = array( $q['s'] ); 1310 1310 } else { 1311 1311 if ( preg_match_all( '/".*?("|$)|((?<=[\t ",+])|^)[^\t ",+]+/', $q['s'], $matches ) ) { 1312 $q['search_terms_count'] = count( $matches[0] );1313 1312 $q['search_terms'] = $this->parse_search_terms( $matches[0] ); 1313 $q['search_terms_count'] = count( $q["search_terms"] ); 1314 1314 // if the search string has only short terms or stopwords, or is 10+ terms long, match it as sentence 1315 1315 if ( empty( $q['search_terms'] ) || count( $q['search_terms'] ) > 9 ) 1316 1316 $q['search_terms'] = array( $q['s'] );