Skip to content

Instantly share code, notes, and snippets.

@jchristopher
Created September 6, 2017 02:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jchristopher/28fddaa3357349d64a11c12a4f458078 to your computer and use it in GitHub Desktop.
Save jchristopher/28fddaa3357349d64a11c12a4f458078 to your computer and use it in GitHub Desktop.
<?php
add_filter( 'searchwp_query_join', function( $sql, $post_type, $engine ) {
global $wpdb;
return "LEFT JOIN {$wpdb->prefix}term_relationships as swp_tax_rel ON swp_tax_rel.object_id = {$wpdb->prefix}posts.ID";
}, 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment