Action
rpress_reservation_created
On this page
Fires after a reservation is stored.
Runs after a reservation is created, either from the front end through rpress_insert_reservation() or from the admin details box. RestroPress uses it to send the received or confirmed email, to notify the admin and to schedule the reminder for confirmed reservations. The args array carries source and, for admin saves, notify.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$post_id | int | Reservation ID. |
$status | string | Initial status. |
$args | array | Insert arguments; the admin path passes source and notify. |
Example#
function my_on_reservation_created( $id, $status, $args ) {
if ( 'confirmed' === $status ) {
update_post_meta( $id, 'my_synced', 0 );
}
}
add_action( 'rpress_reservation_created', 'my_on_reservation_created', 10, 3 );
Notes#
Fired from the front-end insert function with its $args (validate, status, source) and from the admin save with array( 'source' => 'admin', 'notify' => $notify ). The first parameter is named $id in the insert function. Core callbacks run at priority 10 (emails) and 20 (reminder).
Source#
Fired from:
includes/features/reservations/admin.php(line 620), inrpress_reservation_save_details()includes/features/reservations/functions.php(line 500), inrpress_insert_reservation()
See also#
Was this page helpful?
