Automattic\WooCommerce\Internal\Caches
VersionStringGenerator::get_cache_key
Get the cache key for an ID.
The ID is hashed to ensure a consistent key length and avoid issues with special characters or very long IDs.
Method of the class: VersionStringGenerator{}
No Hooks.
Returns
String. The cache key.
Usage
// private - for code of main (parent) class only $result = $this->get_cache_key( $id ): string;
- $id(string) (required)
- The ID to get the cache key for.
VersionStringGenerator::get_cache_key() VersionStringGenerator::get cache key code WC 10.4.3
private function get_cache_key( string $id ): string {
return 'wc_version_string_' . md5( $id );
}