fix search whitout taxonomies #16

This commit is contained in:
Leo Germani 2018-07-26 09:19:24 -03:00
parent ded79f7145
commit 3af2026327
1 changed files with 5 additions and 1 deletions

View File

@ -258,6 +258,10 @@ class Search_Engine {
global $wpdb;
$vars = $this->query_instance->query_vars;
if (empty($this->taxonomies)) {
return '';
}
$s = $vars['s'];
$search_terms = $this->get_search_terms();
$exact = isset( $vars['exact'] ) ? $vars['exact'] : '';
@ -325,7 +329,7 @@ class Search_Engine {
function terms_join( $join ) {
global $wpdb;
if ( !empty( $this->query_instance->query_vars['s'] ) ) {
if ( !empty( $this->query_instance->query_vars['s'] ) && !empty( $this->taxonomies ) ) {
foreach ( $this->taxonomies as $taxonomy ) {
$on[] = "ttax.taxonomy = '" . addslashes( $taxonomy )."'";