Support

Home Forums Event Espresso Premium Archive events other than trash

Archive events other than trash

Posted: September 4, 2018 at 1:12 am


rahmanmemon

September 4, 2018 at 1:12 am

In event expresso is there away to archive events other than trash? Some events we like to keep in past events so don’t want to trash them. Also a lot of events we will reuse in the future so good if we can somehow file away from the current ones.


rahmanmemon

September 4, 2018 at 2:06 am

I want to hide expire event from the front end but i am using custom query instead of default shortcode can you please help me to exclude expired event if using custom query
Also i am getting all the attribute using $post_object = get_post( $post_id ); ao i want to get expired attribute using $post_object


Josh

  • Support Staff

September 4, 2018 at 10:45 am

Hi,

Event Espresso does not have an “archive” feature for events in the way you describe, and there isn’t an “expired” attribute attached to the $post_object.

What you can do instead is do a JOIN on the esp_datetime table to get the datetimes of the event. Event Espresso 4 core does something similar when it does the query for the native WP custom post type archive for events.

Here’s a link to the source that shows how EE4 core filters out expired events:

https://github.com/eventespresso/event-espresso-core/blob/master/core/CPTs/EE_CPT_Event_Strategy.core.php#L64

You can review the methods there for:
posts_fields
posts_join
posts_where

The support post ‘Archive events other than trash’ 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