pmpro_getMemberOrdersByCheckoutID

Get an array of orders for a specific checkout ID.

Description

pmpro_getMemberOrdersByCheckoutID( (int) $checkout_id ); 

Parameters (1)

0. $checkout_id (int)
The checkout id.

Usage

  1. if ( !function_exists( 'pmpro_getMemberOrdersByCheckoutID' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/includes/functions.php'; 
  3.  
  4. // The checkout id. 
  5. $checkout_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = pmpro_getMemberOrdersByCheckoutID($checkout_id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/includes/functions.php  
  1. function pmpro_getMemberOrdersByCheckoutID($checkout_id) { 
  2. global $wpdb; 
  3.  
  4. $order_ids = $wpdb->get_col($wpdb->prepare("SELECT id FROM $wpdb->pmpro_membership_orders WHERE checkout_id = %d", $checkout_id)); 
  5.  
  6. $r = array(); 
  7. foreach($order_ids as $order_id) { 
  8. $r[] = new MemberOrder($order_id); 
  9.  
  10. return $r;