searchwp\statistics\log
4.0.0以降
SearchWPがこの検索をログに記録するかどうかを制御します。
パラメータ
| タイプ | パラメータ | デフォルト | 提供開始 |
|---|---|---|---|
| ブール値 | $enabled |
true (検索クエリが無視されない場合) |
4.0.0 |
| \SearchWP\Query | $query |
実行中のクエリ | 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 | |
| // Disable SearchWP's logging of searches for anyone who is logged in. | |
| add_filter( 'searchwp\statistics\log', function( $enabled, $query ) { | |
| return ! is_user_logged_in(); | |
| }, 20, 2 ); |

