searchwp\query\partial_matches\tokens
Seit: 4.0.0
Manipulieren Sie Teilübereinstimmungs-Tokens während der Anwendung der Teilübereinstimmungslogik.
Parameter
| Typ | Parameter | Standard | Seit | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| String[] | $partial_tokens |
Von SearchWP gefundene Teilübereinstimmungstoken | 4.0.0 |
||||||||||||
| Array |
$args
|
4.0.0 |
|||||||||||||
Beispiele
All hooks should be added to your custom SearchWP Customizations Plugin.
Füge 'Kaffee' immer zu Teilübereinstimmungen hinzu, auch wenn es nicht der Fall ist
Wenn Sie das Wort „Kaffee“ immer zur Liste der Teilübereinstimmungen hinzufügen möchten:
This file contains hidden or 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 | |
| // Always add 'coffee' to partial matches even if it's not. | |
| add_filter( 'searchwp\query\partial_matches\tokens', function( $partial_match_tokens, $args ) { | |
| $partial_match_tokens[] = 'coffee'; | |
| return $partial_match_tokens; | |
| }, 10, 2 ); |

