searchwp\tokens
Seit: 4.0.0
Manipulieren Sie Tokens sowohl bei der Indizierung als auch bei der Suche.
Parameter
| Typ | Parameter | Standard | Seit |
|---|---|---|---|
| String[] | $tokens |
Tokens nach Anwendung der Regeln | 4.0.0 |
Beispiele
All hooks should be added to your custom SearchWP Customizations Plugin.
Firmennamen aus Tokens entfernen
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 | |
| // Remove company name "ACME" from tokens in SearchWP. | |
| add_filter( 'searchwp\tokens', function( $tokens ) { | |
| return array_filter( $tokens, function( $token ) { | |
| return 'ACME' !== $token; | |
| } ); | |
| } ); |

