Changeset 4360 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/camptix-badge-generator/includes/common.php
- Timestamp:
- 11/15/2016 07:51:09 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/camptix-badge-generator/includes/common.php
r4358 r4360 66 66 * Get the attendees 67 67 * 68 * @param string|array $ticket_ids Reduce fetched attendees by the ticket they purchased. The string 'all' 69 * will result in all attendees being fetched, regardless of their 70 * ticket. An array of ticket IDs will result in only the attendees for 71 * those tickets being fetched. 72 * @param string $registered_after Reduce fetched attendees by their registration date. Any value parseable 73 * by strtotime(). 74 * 75 * @todo Maybe optimize this by looking at post_date rather than tix_timestamp 76 * 68 77 * @return array 69 78 */ 70 function get_attendees( ) {71 $ attendees = get_posts(array(79 function get_attendees( $ticket_ids = 'all', $registered_after = '' ) { 80 $params = array( 72 81 'post_type' => 'tix_attendee', 73 82 'posts_per_page' => 12000, 83 'order' => 'ASC', 74 84 'orderby' => 'title', 75 ) ); 85 'meta_query' => array(), 86 ); 87 88 if ( 'all' !== $ticket_ids ) { 89 $params['meta_query'][] = array( 90 'key' => 'tix_ticket_id', 91 'value' => $ticket_ids, 92 'compare' => 'IN', 93 ); 94 } 95 96 if ( ! empty( $registered_after ) ) { 97 $params['meta_query'][] = array( 98 'key' => 'tix_timestamp', 99 'value' => strtotime( $registered_after ), 100 'compare' => '>=', 101 ); 102 } 103 104 $attendees = get_posts( $params ); 76 105 77 106 return $attendees;
Note: See TracChangeset
for help on using the changeset viewer.