WC_Cache_Helper::get_cache_prefix()
Get prefix for use with wp_cache_set. Allows all cache in a group to be invalidated at once.
Method of the class: WC_Cache_Helper{}
No Hooks.
Return
String
.
Usage
$result = WC_Cache_Helper::get_cache_prefix( $group );
- $group(string) (required)
- Group of cache to get.
WC_Cache_Helper::get_cache_prefix() WC Cache Helper::get cache prefix code WC 7.3.0
public static function get_cache_prefix( $group ) { // Get cache key - uses cache key wc_orders_cache_prefix to invalidate when needed. $prefix = wp_cache_get( 'wc_' . $group . '_cache_prefix', $group ); if ( false === $prefix ) { $prefix = microtime(); wp_cache_set( 'wc_' . $group . '_cache_prefix', $prefix, $group ); } return 'wc_cache_' . $prefix . '_'; }