• Resolved gr9zz

    (@gr9zz)


    Hello,
    I would like to know if it is possible to display the status of an event : open, finished, cancelled, full etc.
    Thanks

    • This topic was modified 3 years, 5 months ago by gr9zz.
Viewing 4 replies - 1 through 4 (of 4 total)
  • 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 ?

    Plugin Support angelo_nwl

    (@angelo_nwl)

    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;
    }
    Thread Starter gr9zz

    (@gr9zz)

    Hello,
    Thanks !

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Events status’ is closed to new replies.