Hi, I’m using a custom Events Table View Template to display a list of upcoming events using the shortcode above. Events will disappear from the list when setting ‘show_expired=false’. That is working fine. Is there a way to set each event to expire (disappear) the next morning at 8am instead of the default time. Ideally, it’d be great to use the ‘Sell Until’ setting to set the time to expire. Thanks!
Yes it’s possible but there’s some extra work involved to make that happen.
The first step is you change the shortcode to use show_expired=true, because now you’ll be showing events that may have actually expired, but the “Sell Until” date hasn’t come yet.
Then, the second step is to programmatically set the event to be removed from the list when the Sell Until date comes. You add the code from this snippet to a plugin, then activate the plugin:
Thank you! We are testing this now. One question: Is it possible to have this work on only one Table View? We have two pages, Upcoming Events (which this code will be implemented), and Past Events (a list of all meetings which have expired).
Yes you can. What you do is take those two lines of code that start with add_filter and move them into a function that checks the current page. Then if it’s the “Upcoming Events” page it will run the filter code.
The support post ‘Events Table View Template – Display expired event until next morning 8am?’ 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.
Support forum for Event Espresso 3 and Event Espresso 4.