WC_Order_Item_Data_Store::clear_caches( int $item_id, int|null $order_id )

Clear meta cache.


Description Description


Parameters Parameters

$item_id

(Required) Item ID.

$order_id

(Required) Order ID. If not set, it will be loaded using the item ID.


Top ↑

Source Source

File: includes/data-stores/class-wc-order-item-data-store.php

	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' );
		}
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.