searchwp\query\partial_matches\force
Since: 4.0.0
Table of Contents
Force SearchWP to execute its partial matching logic despite results being found.
Parameters
Type | Parameter | Default | Since | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Boolean | $force |
false |
4.0.0 |
|||||||||
Array |
$args
|
4.0.0 |
Examples
All hooks should be added to your custom SearchWP Customizations Plugin.
Force partial match logic when searching
By default partial logic is not applied if matches are found, but it can be forced
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 | |
// Force partial matches in SearchWP even when matches are found using provided search. | |
add_filter( 'searchwp\query\partial_matches\force', function( $force, $args ) { | |
return true; | |
}, 10, 2 ); |