Available since: 3.0
searchwp_partial_matches_lenient
View Parameters »When partial matching is enabled, SearchWP will attempt to find partial matches regardless of whether an exact match was used in the search string.
You can prevent SearchWP from finding partial matches if there is an exact match using this hook:
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 | |
// Prevent SearchWP from finding partial matches if an exact match is found. | |
add_filter( 'searchwp_partial_matches_lenient', function( $lenient, $args ) { | |
// $args['engine'] is the engine being used | |
return false; // true/false | |
}, 20, 2 ); |
Parameters
Parameter | Type | Description |
---|---|---|
$lenient |
Boolean |
Whether to find partial matches when exact matches are found |
$args |
Array |
|