How can I modify the displayed Monthly class schedule widget
[eo_fullcalendar]
I want to added to the displayed text so it says “CLOSED” on the end when it’s past it’s date and also say “CLASS FULL” when the class is fully booked.
Thanks for any help.

Chris Christenson
Hi Chris,
Something like this should work:
function my_mark_event_as_booked( $event, $event_id, $occurrence_id ){
$now = new \DateTime();
if ( eo_get_the_start(DATETIMEOBJ, $event_id, $occurrence_id) < $now ) {
$event['title'] = $event['title'] . " (Closed)"; //change title (optional!)
$event['description'] = "<strong>Closed.</strong> <br>" . $event['description']; //change tooltip content (optional!)
return $event;
}
//Check if the event has tickets
if( eo_get_event_tickets( $event_id ) ){
//Check if the event has any tickets remaining
if( eventorganiser_pro_get_option( 'book_series' ) ){
$remaining = eo_get_remaining_tickets_count( $event_id );
}else{
$remaining = eo_get_remaining_tickets_count( $event_id, $occurrence_id );
}
if( 0 == $remaining ){
$event['title'] = $event['title'] . " (Fully booked)"; //change title (optional!)
$event['description'] = "<strong>Fully booked.</strong> <br>" . $event['description']; //change tooltip content (optional!)
}
}
return $event;
}
add_filter( 'eventorganiser_fullcalendar_event', 'my_mark_event_as_booked', 10, 3 );
The calendar is cached, so you’ll need to disable that:
// Disable caching
add_filter( 'pre_transient_eo_full_calendar_public', '__return_null');

Stephen Harris
Where do I put this code?
Thanks for the help

Chris Christenson
Ideally in a utility plugin. But it would also work in a theme/child-theme’s functions.php: https://wp-event-organiser.com/blog/tutorial/where-should-i-put-code-from-the-tutorials/

Stephen Harris