searchwp\weights
Desde: 4.0.0
Tabla de contenidos
Personaliza los intervalos de peso disponibles al configurar los atributos de origen del motor de SearchWP.
Parámetros
| Tipo | Parámetro | Predeterminado | Desde |
|---|---|---|---|
| Matriz | $weights |
Las claves de matriz son enteros que representan el peso, el valor es la etiqueta del peso | 4.0.0 |
Ejemplos
All hooks should be added to your custom SearchWP Customizations Plugin.
Personalizar los pesos de los atributos de origen del motor 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', | |
| ]; | |
| } ); |

