WC_Data::generate_meta_cache_key()public staticWC 4.7.0

Generate cache key from id and group.

{} It's a method of the class: WC_Data{}

No Hooks.

Return

String. Meta cache key.

Usage

$result = WC_Data::generate_meta_cache_key( $id, $cache_group );
$id(int|string) (required)
Object ID.
$cache_group(string) (required)
Group name use to store cache. Whole group cache can be invalidated in one go.

Changelog

Since 4.7.0 Introduced.

Code of WC_Data::generate_meta_cache_key() WC 6.8.2

public static function generate_meta_cache_key( $id, $cache_group ) {
	return WC_Cache_Helper::get_cache_prefix( $cache_group ) . WC_Cache_Helper::get_cache_prefix( 'object_' . $id ) . 'object_meta_' . $id;
}