I’m trying this code to get all the events between the two dates which works, but I also want all the RSVP tickets for each event which doesn’t work. The file attendees-email.php gets all the tickets for an event, but I’m confused how to load the variables properly on my own and am clearly missing something. I don’t know how to get the ticketing data for each event…The $items variable is possibly the problem.
<?php;
global $post; // Ensure the global $post variable is in scope
$events = tribe_get_events( array(
'start_date' => date( '2016-01-01 12:00:00' ),
'end_date' => date( '2026-12-31 12:00:00' ),
'eventDisplay' => 'custom',
'posts_per_page' => -1
));
if ( empty( $events ) ) {
echo 'Sorry, nothing found.';
}
else foreach( $events as $post ) {
setup_postdata( $post );
echo get_the_title($post).', '.tribe_get_start_date().', '.tribe_get_city().', '.tribe_get_state().', '.tribe_get_country(). PHP_EOL;
foreach ( $items as $item ) {
foreach ( $item as $field ) {
echo $field;
}
}
}
?>