We are thrilled to release our latest update, Events Manager 7.2, another major milestone in the evolution of the plugin with added support for …. timeslots! 🎉
This major new feature involved another overhaul of time-based logic under the hood. Now, you can create single-day events without needing to create recurring events to add multiple times in a day.
What this means
Whilst seemingly a nuance on event creation, this powerful new feature opens the door to a LOT of new possibilities, including truly supporting different event types, such as appointments and general bookings based on multiple times in a day. Along with a new timeslot picker during the booking process, this new coding structure makes the logistics of managing multiple fractions of the same event on the same day much easier.
If you want to go crazy, timeslots are also supported in recurring events too! That means you could create the same event for multiple parts of the week, month, year (or whatever) with different timeslot patterns, date ranges or even different timezones! We’ve meticulously developed this framework of code to layer into all our features to create truly flexible and powerful event structures.
As an example, having wrapped up 7.2, we spent only a few hours to develop a new Pro feature in 3.7.2 for recurring events (launched in 7.1) and timeslots; moving bookings between dates and times. Previously, this sort of feature would have involved clunky coding and required a significantly longer amount of time to implement.
Events Manager Pro Compatibility
We always strive to make our updates compatible with previous Pro versions. In some situations such as this, it’s impossible to implement such powerful features without requiring some updates to our Pro version. Therefore, Pro 3.7.2 is required for timeslot support, and timeslot support is automatically disabled to prevent undesirable and unintended behaviour. However, earlier Pro versions will still work normally but without timeslot support, just as before.
Going Forward
The latest three major updates (7.0, 7.1 and 7.2) have required monumentous amounts of time and effort to implement in this relatively short amount of time. This follows up on a big push for a mountain of different feature updates over the past year.
We’re going to focus momentarily on resolving known bugs, compatibility issues with third party plugins and updating our documentation and website which has had a hard time keeping up with all our addtitions, enhancements and overhauls! We look forward to having the chance to show you all the power of our new suite of functionality before we continue with this exciting journey of creating the most powerful event framework out there.
Developer Notes
Whilst we’ll now be reviewing and updating our documentation to match these new features, there are some general cosiderations to keep in mind especially with current custom code:
event_id
can now be a string, representing the event ID and a timeslot ID, for example$EM_Event->event_id
may produce something like 123:123 if the event has timeslots.- We will now refer to event IDs which include the timeslot as an Event UID
- Supplying an event UID to
em_get_event()
or newEM_Event()
will load an event with a timeslot_id populated. - To get the actual event ID you can now use the
get_event_id()
method on theEM_Event
,EM_Booking
, andEM_Ticket_Booking(s)
objects. - Individual Event timeslots are not stored in wp_em_events, rather are combined with the new table wp_em_event_timeslots re-using the same event_id for same-day timeslots.
- The general event containing timeslots will have the first time and ending time of all the timeslots on that day, and acts like a normal start/end datetime if you load up the general event ID without a timeslot context.
There’s a ton more that goes on under the hood, but we hope these important considerations will help you transition your custom code if necessary. Generally speaking, if you load event with supplied event IDs, just ensure you don’t do any is_numeric()
checks, and change that to something like preg_match( '/^(\d+):(\d+)$/', $event_id, $matches )
instead.
Changelogs
Short but sweet, here’s the changes, each one packs a punch!