WC_Order_Data_Store_CPT::prime_caches_for_orders()publicWC 1.0

Helper method to prime caches for orders. Call this if you are going to be fetching orders in a loop.

Method of the class: WC_Order_Data_Store_CPT{}

No Hooks.


null. Nothing.


$WC_Order_Data_Store_CPT = new WC_Order_Data_Store_CPT();
$WC_Order_Data_Store_CPT->prime_caches_for_orders( $order_ids, $query_vars );
$order_ids(array) (required)
List of order IDS to prime caches for.
$query_vars(array) (required)
Original query arguments.

WC_Order_Data_Store_CPT::prime_caches_for_orders() code WC 7.5.1

public function prime_caches_for_orders( $order_ids, $query_vars ) {
	// Lets do some cache hydrations so that we don't have to fetch data from DB for every order.
	$this->prime_raw_meta_cache_for_orders( $order_ids, $query_vars );
	$this->prime_refund_caches_for_order( $order_ids, $query_vars );
	$this->prime_order_item_caches_for_orders( $order_ids, $query_vars );