Skip to content
Docs
Get RestroPress

Filter

rpress_reports_cache_ttl

Updated
On this page

Filters how long report data is cached, in seconds.

Runs each time the reports screen loads a cached data set. Results are stored in transients whose keys start with rpress_rep_ and depend on the selected filters. Return 0 or a negative number to disable caching.

Parameters#

ParameterTypeDescription
$ttlintCache lifetime in seconds. Default 120.

Return value#

int. Lifetime in seconds; 0 or less disables caching.

Example#

function my_reports_cache_ttl( $ttl ) {
	return 600;
}
add_filter( 'rpress_reports_cache_ttl', 'my_reports_cache_ttl', 10, 1 );

Source#

Applied in:

  • includes/admin/reporting/class-rpress-reports-intelligence.php (line 131), in RPRESS_Reports_Intelligence::cached()
Was this page helpful?