WC_Order_Data_Store_CPT::prime_caches_for_orders()
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.
Return
null
. Nothing (null).
Usage
$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() WC Order Data Store CPT::prime caches for orders code WC 9.4.2
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 ); }