searchwp\pesi
Da: 4.0.0
Indice
Personalizza gli intervalli di peso disponibili durante la configurazione degli attributi di origine del motore SearchWP.
Parametri
| Tipo | Parametro | Predefinito | Da |
|---|---|---|---|
| Array | $pesi |
Le chiavi dell'array sono numeri interi che rappresentano il peso, il valore è l'etichetta del peso | 4.0.0 |
Esempi
Tutti gli hook dovrebbero essere aggiunti al tuo plugin personalizzato SearchWP Customizations Plugin.
Personalizza i pesi degli attributi della sorgente del motore disponibili
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 | |
| // Customize available Engine Source Attribute weights in SearchWP. | |
| add_filter( 'searchwp\weights', function( $weights ) { | |
| // Make available only two weight choices. | |
| return [ | |
| 1 => 'Lowest', | |
| 1000 => 'Highest', | |
| ]; | |
| } ); |
