Skip to content
Docs
Get RestroPress

Action

rpress_reservation_created

Updated
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#

ParameterTypeDescription
$post_idintReservation ID.
$statusstringInitial status.
$argsarrayInsert 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), in rpress_reservation_save_details()
  • includes/features/reservations/functions.php (line 500), in rpress_insert_reservation()

See also#

Was this page helpful?