Available since: 1.1
searchwp_query_join
View Parameters »If you would like to manually JOIN
more tables during the main search query, this filter will allow you to inject your own JOIN
clause.
Example: To include your own JOIN
s, add the following to your active theme’s functions.php
:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_searchwp_query_join( $sql, $postType, $engine ) { | |
// modify $sql to your liking | |
return $sql; | |
} | |
add_filter( 'searchwp_query_join', 'my_searchwp_query_join', 10, 3 ); |
Parameters
Parameter | Type | Description |
---|---|---|
$sql |
String |
The default SQL |
$postType |
String |
The current post type (all post types are iterated) |
$engine |
String |
The search engine being used |