WC_Data::get_meta_cache_key()publicWC 4.7.0

Helper method to compute meta cache key. Different from WP Meta cache key in that meta data cached using this key also contains meta_id column.

Method of the class: WC_Data{}

No Hooks.

Return

String.

Usage

$WC_Data = new WC_Data();
$WC_Data->get_meta_cache_key();

Changelog

Since 4.7.0 Introduced.

WC_Data::get_meta_cache_key() code WC 8.7.0

public function get_meta_cache_key() {
	if ( ! $this->get_id() ) {
		wc_doing_it_wrong( 'get_meta_cache_key', 'ID needs to be set before fetching a cache key.', '4.7.0' );
		return false;
	}
	return self::generate_meta_cache_key( $this->get_id(), $this->cache_group );
}