Abstract_WC_Order_Data_Store_CPT::clear_caches()protectedWC 3.0.0

Clear any caches.

Method of the class: Abstract_WC_Order_Data_Store_CPT{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->clear_caches( $order );
$order(WC_Order) (required) (passed by reference — &)
Order object.

Changelog

Since 3.0.0 Introduced.

Abstract_WC_Order_Data_Store_CPT::clear_caches() code WC 8.7.0

protected function clear_caches( &$order ) {
	clean_post_cache( $order->get_id() );
	wc_delete_shop_order_transients( $order );
	wp_cache_delete( 'order-items-' . $order->get_id(), 'orders' );
}