Your cart is empty!
Status Change
do_action( 'vikrestaurants_status_change_restaurant_reservation', array $data )
Fires every time the status of a reservation changes.
Description
Trigger event to let the plugins be notified every time the status of a restaurant reservation changes.
This hook also fires when a new reservation is created, since its initial status always differs from the previously configured status, which did not exist before the reservation was created.
It is possible to use the following code to access all the details of the reservation.
$reservation = VREOrderFactory::getReservation($data['id']);
Parameters
- $data
-
(array) The details of the saved reservation.
id(int) - The ID of the created/updated reservation.status(string) - The new status code of the reservation.prev(string) - The previous status code of the reservation. Empty in case the reservation has been created.
Example
/**
* Trigger event to let the plugins be notified every time the status of the reservations change.
*
* @param array $data The details of the saved reservation.
*/
add_action('vikrestaurants_status_change_restaurant_reservation', function($data) {
/**
* @todo status change observed, do something now
*/
}); Changelog
| Version | Description |
|---|---|
| 1.3 | Introduced. |
| 1.5.5 | The $data argument no longer contains extra details about the updated reservation. |
Last Update: 3 days ago
Helpful?