Skip to content

Commit

Permalink
update posts_join for search
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpaulbalagolan committed May 11, 2018
1 parent f7adc43 commit fcc4259
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ function oet_search_where($where){
function oet_search_join($join){
global $wpdb;
if (is_search())
$join .= "LEFT JOIN {$wpdb->term_relationships} tr ON {$wpdb->posts}.ID = tr.object_id INNER JOIN {$wpdb->term_taxonomy} tt ON tt.term_taxonomy_id=tr.term_taxonomy_id INNER JOIN {$wpdb->terms} t ON t.term_id = tt.term_id";
$join .= "LEFT JOIN {$wpdb->term_relationships} tr ON ({$wpdb->posts}.ID = tr.object_id) LEFT JOIN {$wpdb->term_taxonomy} tt ON (tt.taxonomy = 'post_tag' AND tt.term_taxonomy_id=tr.term_taxonomy_id) LEFT JOIN {$wpdb->terms} t ON (tt.term_id = t.term_id)";
return $join;
}
add_filter( "posts_join" , "oet_search_join" );
Expand Down

0 comments on commit fcc4259

Please sign in to comment.