searchwp\tokens\tokenize_pattern_matches
4.0.0以降
正規表現パターンマッチを個々の部分にトークン化するかどうかを制御します。
デフォルトでは、SearchWPは完全なトークン正規表現パターンマッチに結果を制限します。これにより、検索結果が制限され、より的を絞った関連性の高い結果が得られる可能性が高くなります。
このフックを使用してパターンマッチのトークン化を有効にすると、各パターンが個別の検索語として含まれるため、結果が大幅に増える可能性が非常に高くなります。
パラメータ
| タイプ | パラメータ | デフォルト | 提供開始 |
|---|---|---|---|
| ブール値 | $enabled |
SearchWP設定画面の「高度な設定」タブのチェックボックスの状態 | 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 | |
| // Enable regex pattern match tokenization in SearchWP. | |
| add_filter( 'searchwp\tokens\tokenize_pattern_matches', '__return_true' ); |

