WordPress at Your Fingertips
function is not described

WC_Order_Item_Data_Store::clear_caches() protected WC 1.0

Clear meta cache.

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

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->clear_caches( $item_id, $order_id );
$item_id(int) (required)
Item ID.
$order_id(int|null) (required)
Order ID. If not set, it will be loaded using the item ID.

Code of WC_Order_Item_Data_Store::clear_caches() WC 5.8.0

protected function clear_caches( $item_id, $order_id ) {
	wp_cache_delete( 'item-' . $item_id, 'order-items' );

	if ( ! $order_id ) {
		$order_id = $this->get_order_id_by_order_item_id( $item_id );
	}
	if ( $order_id ) {
		wp_cache_delete( 'order-items-' . $order_id, 'orders' );
	}
}