WC_Data::delete_meta_cachepublicWC 11.0.0

Delete this object's cached raw meta data entry, if a cache group is set.

Counterpart to prime_raw_meta_data_cache(): it removes the entry stored under this object's own cache group (for example 'orders' for WC_Abstract_Order), so the next read_meta_data() misses the cache and re-reads from the database. Used to recover from a corrupt persistent object cache entry.

Method of the class: WC_Data{}

No Hooks.

Returns

null. Nothing (null).

Usage

$WC_Data = new WC_Data();
$WC_Data->delete_meta_cache(): void;

Changelog

Since 11.0.0 Introduced.

WC_Data::delete_meta_cache() code WC 11.0.1

public function delete_meta_cache(): void {
	if ( empty( $this->cache_group ) || ! $this->get_id() ) {
		return;
	}
	$cache_key = self::generate_meta_cache_key( $this->get_id(), $this->cache_group );
	wp_cache_delete( $cache_key, $this->cache_group );
}