Changeset 7913 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/camptix-badge-generator/includes/common.php
- Timestamp:
- 11/29/2018 03:19:23 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/camptix-badge-generator/includes/common.php
r6768 r7913 72 72 * @param string $registered_after Reduce fetched attendees by their registration date. Any value parseable 73 73 * by strtotime(). 74 * @param string $admin_flag Filter fetched attendees to only those who have the given admin flag 75 * assigned. 74 76 * 75 77 * @todo Maybe optimize this by looking at post_date rather than tix_timestamp … … 77 79 * @return array 78 80 */ 79 function get_attendees( $ticket_ids = 'all', $registered_after = '' ) {81 function get_attendees( $ticket_ids = 'all', $registered_after = '', $admin_flag = '' ) { 80 82 $params = array( 81 83 'post_type' => 'tix_attendee', … … 103 105 104 106 $attendees = get_posts( $params ); 107 108 if ( '' !== $admin_flag ) { 109 $attendees = array_filter( $attendees, function( $attendee ) use ( $admin_flag ) { 110 $flags = get_post_meta( $attendee->ID, 'camptix-admin-flag' ); 111 112 return in_array( $admin_flag, $flags, true ); 113 } ); 114 } 105 115 106 116 return $attendees;
Note: See TracChangeset
for help on using the changeset viewer.