Action
rpress_reservation_status_changed
On this page
Fires after a reservation status changes.
Runs in rpress_set_reservation_status() after the new status is stored; it does not run when the status is unchanged or invalid. Core uses it to send the customer emails and to reschedule the reminder. When $notify is false the caller asked for no customer emails.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$id | int | Reservation ID. |
$status | string | New status. |
$old | string | Previous status. |
$notify | bool | Whether customer emails should go out. |
Example#
function my_reservation_status_changed( $id, $status, $old, $notify ) {
if ( 'cancelled' === $status ) {
error_log( sprintf( 'Reservation %d changed from %s to cancelled.', $id, $old ) );
}
}
add_action( 'rpress_reservation_status_changed', 'my_reservation_status_changed', 10, 4 );
Notes#
Core callbacks run at priority 10 and 20.
Source#
Fired from:
includes/features/reservations/functions.php(line 654), inrpress_set_reservation_status()
See also#
Was this page helpful?
