Available since: 2.9.14
searchwp_dashboard_widget_transient_ttl
View Parameters »By default SearchWP will use a transient to store Dashboard Widget data so as to improve performance. You can customize the duration of the time to live for this cached data:
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 | |
add_filter( 'searchwp_dashboard_widget_transient_ttl', function( $duration ) { | |
// Only store Dashboard Widget data as transient for 1 hour (instead of default 12). | |
return HOUR_IN_SECONDS; | |
} ); |
Parameters
Parameter | Type | Description |
---|---|---|
$ttl |
Integer |
Number of seconds to cache widget data |