searchwp\tokens
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
All hooks should be added to your custom 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; | |
| } ); | |
| } ); |

