searchwp\query\do_source_db_where
Since: 4.0.0
Table of Contents
Control whether SearchWP considers the db_where()
criteria for Sources.
This functionality adds a layer of protection against content edits that were made in such a way that SearchWP’s indexer was not able to capture.
If you are confident that your content edits are all taking place through APIs as captured by the Sources you’re using you can omit this additional check, saving database calls and increasing performance.
Parameters
Type | Parameter | Default | Since |
---|---|---|---|
Boolean | $enabled |
true |
4.0.0 |
\SearchWP\Query | $query |
The Query being run | 4.0.0 |
Examples
All hooks should be added to your custom SearchWP Customizations Plugin.
Disable Source database table conditions
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 | |
// Disable Source database table conditions in SearchWP. | |
add_filter( 'searchwp\query\do_source_db_where', function( $enabled, $query ) { | |
return false; | |
}, 30, 2 ); |