woocommerce_analytics_report_should_use_cache
Determines if a report will utilize caching.
Usage
add_filter( 'woocommerce_analytics_report_should_use_cache', 'wp_kama_woocommerce_analytics_report_should_use_cache_filter', 10, 2 );
/**
* Function for `woocommerce_analytics_report_should_use_cache` filter-hook.
*
* @param bool $use_cache Whether or not to use cache.
* @param string $cache_key The report's cache key. Used to identify the report.
*
* @return bool
*/
function wp_kama_woocommerce_analytics_report_should_use_cache_filter( $use_cache, $cache_key ){
// filter...
return $use_cache;
}
- $use_cache(true|false)
- Whether or not to use cache.
- $cache_key(string)
- The report's cache key. Used to identify the report.
Where the hook is called
woocommerce_analytics_report_should_use_cache
woocommerce/src/Admin/API/Reports/DataStore.php 307
return (bool) apply_filters( 'woocommerce_analytics_report_should_use_cache', true, $this->cache_key );