fix textual search in terms names
This commit is contained in:
parent
8e16284851
commit
efbd349f17
|
@ -329,14 +329,14 @@ class Search_Engine {
|
||||||
$searchand = '';
|
$searchand = '';
|
||||||
$searchSlug = '';
|
$searchSlug = '';
|
||||||
foreach ( $search_terms as $term ) {
|
foreach ( $search_terms as $term ) {
|
||||||
$term = $wpdb->prepare("%s", $exact ? $term : "%". sanitize_title_with_dashes($term) . "%");
|
$term = $wpdb->prepare("%s", $exact ? $term : "%". $term . "%");
|
||||||
$searchSlug .= "{$searchand}(tter.slug LIKE $term)";
|
$searchSlug .= "{$searchand}(tter.name LIKE $term)";
|
||||||
$searchand = ' AND ';
|
$searchand = ' AND ';
|
||||||
}
|
}
|
||||||
|
|
||||||
$term = $wpdb->prepare("%s", $exact ? $term : "%". sanitize_title_with_dashes($s) . "%");
|
$term = $wpdb->prepare("%s", $exact ? $term : "%". $s . "%");
|
||||||
if ( count( $search_terms ) > 1 && $search_terms[0] != $s ) {
|
if ( count( $search_terms ) > 1 && $search_terms[0] != $s ) {
|
||||||
$searchSlug = "($searchSlug) OR (tter.slug LIKE $term)";
|
$searchSlug = "($searchSlug) OR (tter.name LIKE $term)";
|
||||||
}
|
}
|
||||||
if ( !empty( $searchSlug ) )
|
if ( !empty( $searchSlug ) )
|
||||||
$search = " OR ({$searchSlug}) ";
|
$search = " OR ({$searchSlug}) ";
|
||||||
|
|
Loading…
Reference in New Issue