searchwp\tokens
Depuis : 4.0.0
Table des matières
Manipuler les jetons lors de l'indexation et de la recherche.
Paramètres
| Type | Paramètre | Défaut | Depuis |
|---|---|---|---|
| Tableau de chaînes | $jetons |
Jetons après l’application des règles | 4.0.0 |
Exemples
All hooks should be added to your custom SearchWP Customizations Plugin.
Supprimer le nom de l’entreprise des jetons
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; | |
| } ); | |
| } ); |

