Automattic\WooCommerce\Admin\API\Reports
DataStore::should_use_cache
Whether or not the report should use the caching layer.
Provides an opportunity for plugins to prevent reports from using cache.
Метод класса: DataStore{}
Хуки из метода
Возвращает
true|false. Whether or not to utilize caching.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->should_use_cache();
Код DataStore::should_use_cache() DataStore::should use cache WC 10.5.2
protected function should_use_cache() {
/**
* Determines if a report will utilize caching.
*
* @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) apply_filters( 'woocommerce_analytics_report_should_use_cache', true, $this->cache_key );
}