searchwp\token
Da: 4.0.0
Indice
Manipola i token sia durante l'indicizzazione che durante la ricerca.
Parametri
| Tipo | Parametro | Predefinito | Da |
|---|---|---|---|
| String[] | $tokens |
Tokens dopo l'applicazione delle regole | 4.0.0 |
Esempi
Tutti gli hook dovrebbero essere aggiunti al tuo plugin personalizzato SearchWP Customizations Plugin.
Rimuovi il nome dell'azienda dai token
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; | |
| } ); | |
| } ); |
