Hello,
You can use add below custom filter and refer to this https://wp-events-plugin.com/tutorials/overriding-event-page-content-with-filters/ to check how the custom filters are added.
add_filter('em_event_output_placeholder','my_em_event_status',100,3);
function my_em_event_status($replace, $EM_Event, $result){
if( $result == '#_EVENTSTATUS' ){
$replace = $EM_Event->status_array[$EM_Event->status];
}
return $replace;
}
and use #_EVENTSTATUS placeholder to display event status.
Thread Starter
gr9zz
(@gr9zz)
Hello,
Thanks, it works but it said “Approved” for a current event and still have space available. It should say “Open”. Is it possible to change this? When it’s no longer possible to book a ticket because the date has passed, the status stays on “approved” when the form says “Bookings are closed for this event.” The status should read “Closed”.
Any idead ?
You can try something like
add_filter('em_event_output_placeholder','my_em_event_status',100,3);
function my_em_event_status($replace, $EM_Event, $result){
if( $result == '#_EVENTSTATUS' ){
if ( $EM_Event->event_rsvp && $EM_Event->get_bookings()->is_open() ){
$replace = 'Open';
}
else if ( $EM_Event->event_rsvp && !$EM_Event->get_bookings()->is_open() ){
$replace = 'Closed';
}
}
return $replace;
}