get_results($wpdb->prepare( "SELECT ID, post_title, post_date FROM {$wpdb->posts} WHERE post_type = 'tribe_events' AND post_author = %d AND post_status = 'publish' ORDER BY post_date DESC", $current_user_id )); // If event is selected, get attendees if ($event_id > 0) { // Verify the event belongs to the current user $event_found = false; foreach ($events as $event) { if ($event->ID == $event_id) { $event_found = true; $selected_event_title = $event->post_title; break; } } if ($event_found) { // Get attendees for the selected event $attendees = $wpdb->get_results($wpdb->prepare( "SELECT p.ID as attendee_id, pm1.meta_value as holder_name, pm2.meta_value as holder_email, pm3.meta_value as check_in FROM {$wpdb->posts} p LEFT JOIN {$wpdb->postmeta} pm1 ON p.ID = pm1.post_id AND pm1.meta_key = '_tribe_tickets_full_name' LEFT JOIN {$wpdb->postmeta} pm2 ON p.ID = pm2.post_id AND pm2.meta_key = '_tribe_tickets_email' LEFT JOIN {$wpdb->postmeta} pm3 ON p.ID = pm3.post_id AND pm3.meta_key = '_tribe_tickets_checked_in' LEFT JOIN {$wpdb->postmeta} pm4 ON p.ID = pm4.post_id AND pm4.meta_key = '_tribe_tickets_event' WHERE p.post_type = 'tribe_ticket_attendee' AND p.post_status = 'publish' AND pm4.meta_value = %d ORDER BY pm1.meta_value ASC", $event_id )); } } } catch (Exception $e) { error_log('Generate Certificates Error: ' . $e->getMessage()); } // Get header get_header(); ?>
Generate certificates for attendees of your events.
You don't have any events yet. Create your first event to start generating certificates.
This event has no attendees yet.
Attendees are created when people register for your event through the ticket system.