searchwp\admin\dashboard_widgets\statistics\days
Since: 4.0.0
Table of Contents
By default the Statistics Dashboard Widget shows popular searches over the past 30 days. Use this hook to modify that default.
Parameters
Type | Parameter | Default | Since |
---|---|---|---|
Integer | $days |
30 |
4.0.0 |
Examples
All hooks should be added to your custom SearchWP Customizations Plugin.
Display popular searches for 7 days
Change the time frame considered for Dashboard Widget Statistics to 7 days
This file contains 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; | |
} ); |