searchwp\tokens
Desde: 4.0.0
Sumário
Manipule tokens tanto na indexação quanto na pesquisa.
Parâmetros
| Tipo | Parâmetro | Padrão | Desde |
|---|---|---|---|
| string[] | $tokens |
Tokens após a aplicação das regras | 4.0.0 |
Exemplos
All hooks should be added to your custom SearchWP Customizations Plugin.
Remover nome da empresa dos tokens
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; | |
| } ); | |
| } ); |

