Changeset 4360
- Timestamp:
- 11/15/2016 07:51:09 PM (8 years ago)
- Location:
- sites/trunk/wordcamp.org/public_html/wp-content/plugins/camptix-badge-generator/includes
- Files:
-
- 3 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; -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/camptix-badge-generator/includes/html-badges.php
r4316 r4360 214 214 ); 215 215 216 $attendees = Badge_Generator\get_attendees( );216 $attendees = Badge_Generator\get_attendees( 'all' ); 217 217 218 218 require( dirname( __DIR__ ) . '/views/html-badges/template-badges.php' ); -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/camptix-badge-generator/includes/indesign-badges.php
r4359 r4360 25 25 /** 26 26 * Build the badge assets for InDesign 27 */ 28 function build_assets() { 27 * 28 * @param array $options 29 */ 30 function build_assets( $options ) { 31 $options = shortcode_atts( 32 array( 33 'ticket_ids' => 'all', 34 'registered_after' => '' 35 ), 36 $options 37 ); 38 29 39 try { 30 40 // Security: assets are intentionally saved to a folder outside the web root. See serve_zip_file() for details. … … 34 44 $zip_filename = get_zip_filename( $assets_folder ); 35 45 $zip_local_folder = pathinfo( $zip_filename, PATHINFO_FILENAME ); 36 $attendees = Badge_Generator\get_attendees( );46 $attendees = Badge_Generator\get_attendees( $options['ticket_ids'], $options['registered_after'] ); 37 47 38 48 wp_mkdir_p( $gravatar_folder );
Note: See TracChangeset
for help on using the changeset viewer.