Detecting when a booking changes status

You may wish to detect when a booking’s status changes, so that you can perform some action (for instance, e-mail the bookee that their booking has been cancelled).

To detect when a booking changes status you can whose one of three hooks:

{$old_status}_to_{$new_status} – to detect when a booking goes from one specific status to another

{$new_status}_eo_booking – to detect when a bookings changes to a specific status

transition_post_status – to detect when a booking change status

(where {$old_status} and {$new_status} should be replaced by the appropriate status).

Note: These are WordPress hooks, not ones provided by the plug-in which is why they do not follow the naming convention of eventorganiser_. Additionally these hooks are triggered for all post types (except number 2), so you should check whether the post changing status is in fact a booking.

When a booking goes from status X to status Y

In this example we e-mail the bookee whenever the booking goes from ‘confirmed’ to ‘cancelled’: