searchwp\query\tokens\limit
4.0.0以降
受け入れられる検索トークンの最大数を制御します。
パラメータ
| タイプ | パラメータ | デフォルト | 提供開始 |
|---|---|---|---|
| 整数 | $max |
10 |
4.0.0 |
| \SearchWP\Query | $query |
実行中のクエリ | 4.0.0 |
例
All hooks should be added to your custom SearchWP Customizations Plugin.
12個までの検索語を受け入れます
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 | |
| // Accept up to 12 search terms in SearchWP. | |
| add_filter( 'searchwp\query\tokens\limit', function( $max, $query ) { | |
| return 12; | |
| }, 30, 2 ); |

