Created
February 14, 2019 16:15
-
-
Save jchristopher/ad2b6d128ad3c91bdfcd964cfdc4a659 to your computer and use it in GitHub Desktop.
Using this hook you can tell SearchWP to find partial matches even if there are exact matches in the search query
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 | |
function searchwp_partial_matches_lenient( $return, $args ) { | |
// $args contains information about this request | |
// - engine | |
// TODO: customize $return to match whether matching should be lenient | |
return $return; | |
} | |
add_filter( 'searchwp_partial_matches_lenient', 'my_searchwp_partial_matches_lenient', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment