Available since: 1.4.1
searchwp_and_logic_only
By default, SearchWP takes an AND pass first when performing searches, followed by an OR pass if the AND pass yields no results. If you would like to force SearchWP to only perform an AND pass and skip the OR pass if no results are found after the AND pass, you can use this filter.
Example: To have SearchWP utilize only AND logic when performing searches, 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 | |
add_filter( 'searchwp_and_logic_only', '__return_true' ); |