better_search_query_posts_search_clauses
Filters the search clauses of Better_Search. This can be used to add custom search clauses.
Type: filter
Since: 4.0.0
Source: includes/class-better-search-core-query.php line 1143
Changelog
| Version | Description |
|---|---|
4.2.0 |
Added $instance parameter. |
4.0.0 |
Introduced. |
Parameters
| Type | Name | Description |
|---|---|---|
array |
$clause |
The search clause of the query. |
string |
$term |
The search term. |
string |
$like_op |
The LIKE operator. |
string |
$andor_op |
The AND/OR operator. |
\WP_Query |
$query |
The WP_Query instance. |
Better_Search_Core_Query |
$instance |
The Better_Search_Core_Query instance (passed by reference). |
Usage
add_filter( 'better_search_query_posts_search_clauses', function($clause, $term, $like_op, $andor_op, $query, $instance) {
// ...
return $clause;
} );