I cancelled a booking today, and it was removed from wp_posts but not wp_eo_booking_tickets. I need to use eo_booking_tickets in order to know what event I am looking for bookings for, but I need the record in wp_posts in order to know who the booking was created by/who it is for. So if I cancel the booking, my code still thinks someone is booked for the event, but can’t find any results in wp_posts when it passes the booking_id’s found from eo_booking_tickets.
Gabriel David
And for verification, I used the cancel button from the admin panel, not a custom coded function or call to eo_cancel or eo_delete
Gabriel David
Hi Gabriel,
I’m not sure why you can’t find the bookings in the post table, but ‘Cancelled’ bookings are not removed from either *_posts
or *_eo_booking_tickets
. Also as a general rule you shouldn’t query eo_booking_tickets
on its own, as there is no indication as to the status of the booking.
You can use eo_get_bookings()
, though, to retrieve bookings matching a query and then eo_get_booking_tickets()
to get the tickets by booking ID (or an array of booking IDs).
Details are on the codex, but eo_get_bookings()
allows you to query bookings by ‘status’. This can be a string or array of statuses. It defaults to ‘any’. Where custom statuses might be used you can use these functions to retrieve all registered booking statuses (or those which a considered ‘confirmed’, or those for which spaces are reserved).
Does that help?
Stephen Harris