Posted: January 21, 2016 at 5:42 am
|
I can’t find what the function that returns an array of IDs of archived events would be? |
Hi Meredith, Can you explain this further please, what do you mean be archived events? |
|
|
I’m looking to use SearchWP to search for just events. However, past events also appear at the moment, and they have this custom function (see below) to exclude certain things, and I’m looking to exclude the past archive events, but I can’t see what the taxonomy would be to add in the code below to replace the ids. Any ideas?
|
With Event Espresso there are no archived events in the way described above. There is no taxonomy to add that will exclude expired events, you need to manually pull in the IDs by querying for all events that have the Datetime end date set in the past (compared with today’s date). Something like this: https://gist.github.com/Pebblo/67b9d4587b6e4810721a Should pull in all of the expired events ID’s from within EE. Note however the code in that gist is intended as an example as is not heavily tested nor supported. |
|
|
Thanks, this worked great. Here was the final function for SearchWP.
|
Thanks for sharing, I’m going to tag this. |
|
The support post ‘function of archived events?’ 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.