SearchWP Documentation

View the installation guide, browse the Knowledge Base, find out about SearchWP’s many hooks

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

<?php
// Disable Source database table conditions in SearchWP.
add_filter( 'searchwp\query\do_source_db_where', function( $enabled, $query ) {
return false;
}, 30, 2 );

How to use this code