Added correct cache handling.

This commit is contained in:
Peter Fabian 2018-12-14 14:13:57 +01:00 committed by Joshua Flowers
parent 6c456657e8
commit 85e6e8df8d
1 changed files with 9 additions and 0 deletions

View File

@ -213,4 +213,13 @@ class WC_Admin_Reports_Coupons_Stats_Data_Store extends WC_Admin_Reports_Coupons
return $data;
}
/**
* Returns string to be used as cache key for the data.
*
* @param array $params Query parameters.
* @return string
*/
protected function get_cache_key( $params ) {
return 'woocommerce_' . self::TABLE_NAME . '_stats_' . md5( wp_json_encode( $params ) );
}
}