Support

Home Forums Event Espresso Premium Add-on Calendar: Show canceled events on show_expired=false

Add-on Calendar: Show canceled events on show_expired=false

Posted: March 19, 2018 at 12:47 pm

Viewing 5 reply threads


motio

March 19, 2018 at 12:47 pm

Hi, Josh helped my in the topic (https://eventespresso.com/topic/add-on-calendar-show-canceled-events-on-show_expiredtrue/) by the following code to disable canceled events in the calendar view.

Unfortunately after ticket sale stops (ticket sale is not available anymore) the events doesn’t show in the calendar with the parameter show_expired=false. This idea with this was to show the attendees the current events on a quick glance. Any idea to show the events that are not canceled and without ticket sale?

function loc_ee_exclude_certain_event_statuses_from_events_calendar( $public_event_stati ) {
if( isset( $_GET[ 'show_expired' ] ) ) {
if( $_GET['show_expired']=='false' ) {
unset( $public_event_stati[ EEM_Event::cancelled ] );
}
}
return $public_event_stati;
}

add_filter(
'AFEE__EED_Espresso_Calendar__get_calendar_events__public_event_stati',
'loc_ee_exclude_certain_event_statuses_from_events_calendar'
);


Tony

  • Support Staff

March 20, 2018 at 5:55 am

Hi there,

The code above removes events with a status of cancelled from the calendar when you have show_expired set to false, it does not remove upcoming events that have tickets that have all expired from the calendar.

This is with the code mentioned above in use on my site – http://take.ms/K5TQf

Viewing the event itself – http://take.ms/Pl3XK

So I’m not sure what is different from my event to yours?

Can you link me to the event so I can view this?


motio

March 21, 2018 at 10:15 am

That is really strange. Besides that after the tickets are not available the entry in the calendar are not shown, if noticed that all expired datetimes doesn’t show up in the calendar with this, even if they are on sale.

Here are the screenshots for the case that the tickets are expired.
Eventpage: http://take.ms/p72JO
Calendar: http://take.ms/7d113 & http://take.ms/kEMFm

Do you need screenshot from the case that the tickets are on sale but expired datetimes doesn’t show? Or other infos?

If tried to disable all plugins and only activated the Core and Calendar Plugin and the custom plugin only with this code. Also tried it with different themes. I also made sure that both plugins are up to date.
Do you have an idea what else I could check.


Tony

  • Support Staff

March 21, 2018 at 12:01 pm

That is really strange. Besides that after the tickets are not available the entry in the calendar are not shown, if noticed that all expired datetimes doesn’t show up in the calendar with this, even if they are on sale.

An expired datetime is a datetime with a event end date in the past, it sounds your telling the calendar not to display expired events/datetimes, but want them to display?

Do you need screenshot from the case that the tickets are on sale but expired datetimes doesn’t show? Or other infos?

Can you add a screenshot of the datetime and ticket editor for the event please?


motio

March 21, 2018 at 1:08 pm

After your feedback I’ve changed the show_expired=false to show_expired=true and the calendar has hidden the canceled events. After that I deactivated the custom plugin with the code and tried it again with show_expired=false with the result, that the calendar has hidden all expired again. I don’t know why but apparently the custom plugin had a problem with the the “false”.

Result: I’ve changed the code to show_expired=active and added that to the calendar shortcode. Now it works like it should.


Tony

  • Support Staff

March 22, 2018 at 12:22 pm

Yeah that is strange, I’m not sure whats happening there but I’m glad it’s now working for you 🙂

Viewing 5 reply threads

The support post ‘Add-on Calendar: Show canceled events on show_expired=false’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso