searchwp\admin\dashboard_widgets\statistics\days
4.0.0以降
デフォルトでは、統計ダッシュボードウィジェットは過去30日間の人気のある検索を表示します。このフックを使用して、そのデフォルトを変更します。
パラメータ
| タイプ | パラメータ | デフォルト | 提供開始 |
|---|---|---|---|
| 整数 | $days |
30 |
4.0.0 |
例
All hooks should be added to your custom SearchWP Customizations Plugin.
7日間の人気検索を表示
ダッシュボードウィジェット統計で考慮される期間を7日間に変更します
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 | |
| // Consider 7 days instead of 30 when displaying Statistics Dashboard Widget. | |
| add_filter( 'searchwp\admin\dashboard_widgets\statistics\days', function( $days ) { | |
| return 7; | |
| } ); |

