searchwp\weights
4.0.0以降
SearchWP エンジンソース属性を設定する際に利用可能な重み間隔をカスタマイズします。
パラメータ
| タイプ | パラメータ | デフォルト | 提供開始 |
|---|---|---|---|
| 配列 | $weights |
配列キーは重みを示す整数で、値はその重みのラベルです | 4.0.0 |
例
All hooks should be added to your custom SearchWP Customizations Plugin.
利用可能なエンジンソース属性の重みをカスタマイズする
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', | |
| ]; | |
| } ); |

