searchwp\tokens
Desde: 4.0.0
Tabla de contenidos
Manipular tokens tanto al indexar como al buscar.
Parámetros
| Tipo | Parámetro | Predeterminado | Desde |
|---|---|---|---|
| string[] | $tokens |
Tokens después de aplicar las reglas | 4.0.0 |
Ejemplos
All hooks should be added to your custom SearchWP Customizations Plugin.
Eliminar el nombre de la empresa de los 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; | |
| } ); | |
| } ); |

