Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Returns an array of all WooTicket products associated with the event.
- *
- * @param null $post_id
- * @return array
- */
- function get_wooticket_products($post_id = null) {
- global $wpdb;
- $id = TribeEvents::postIdHelper($post_id);
- $products = array();
- $product_ids = $wpdb->get_col($wpdb->prepare(
- "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = %s AND meta_value = %d",
- '_tribe_wooticket_for_event', $id
- ));
- if ($product_ids) foreach ($product_ids as $id)
- $products[] = new WC_Product_Simple($id);
- return $products;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement