SearchWP

This Documentation is for SearchWP Version 3

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:

<?php
add_filter( 'searchwp_and_logic_only', '__return_true' );
view raw gistfile1.php hosted with ❤ by GitHub