searchwp\weights
Since: 4.0.0
Table of Contents
Customize the weight intervals available when configuring SearchWP Engine Source Attributes.
Parameters
Type | Parameter | Default | Since |
---|---|---|---|
Array | $weights |
Array keys are integers representing weight, value is the label of the weight | 4.0.0 |
Examples
All hooks should be added to your custom SearchWP Customizations Plugin.
Customize available Engine Source Attribute weights
This file contains 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', | |
]; | |
} ); |