Would you be able to add a “eo_get_current_occurrence_of” function?
This would be the equivalent of “eo_get_next_occurrence_of” but returns an object for the occurrence currently taking place whereas “eo_get_next_occurrence_of” returns the next one even when one is currently happening.
Alternatively, could an optional parameter be added to “eo_get_next_occurrence_of” to allow it to return the current occurrence when there is one or have it respect the “Are current events past?” flag from settings.
Thanks,
Paul
Paul
So there may be dates where this is no occurrence currently occurring – would this return false in those situations?
Also, occurrences can technically overlap (a 2-day event occurring every day, for example). Though its unlikely to occur in practise, it’ll need to decide whether to return the earlier or the later occurrence…
In the meantime if you require the functionality you can use eo_get_the_occurrences_of()
and perform a loop to pull out the correct date.
Stephen Harris
I would return false when there are none – this would be consistent with the other functions.
With overlaps, personally, I’d return the later one as (I would guess that) the person viewing the page is more likely to want to attend the occurrence with the most time left to run.
Alternatively, return an array of all current occurrences and call the function “eo_get_current_occurrences_of” so developers expect to work through an array.
Thanks for the quick response.
Paul
Hi Paul – opened up a ticket for this. Should be in 1.7 (~Feb)
Stephen Harris