searchwp\weights
Depuis : 4.0.0
Table des matières
Personnalisez les intervalles de poids disponibles lors de la configuration des attributs source de SearchWP Engine.
Paramètres
| Type | Paramètre | Défaut | Depuis |
|---|---|---|---|
| Tableau | $poids |
Les clés de tableau sont des entiers représentant le poids, la valeur est l'étiquette du poids | 4.0.0 |
Exemples
All hooks should be added to your custom SearchWP Customizations Plugin.
Personnaliser les poids des attributs de source de moteur disponibles
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', | |
| ]; | |
| } ); |

