Note: You are viewing the documentation for Version 4View Version 3 Docs

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.

Change the time frame considered for Dashboard Widget Statistics to 7 days

<?php
// Consider 7 days instead of 30 when displaying Statistics Dashboard Widget.
add_filter( 'searchwp\admin\dashboard_widgets\statistics\days', function( $days ) {
return 7;
} );

How to use this code

Fix keyword search on your site. No coding required!

Now you can utilize all of the content that's gone unrecognized by native WordPress keyword search instantly with SearchWP

Get SearchWP