Skip to content
Docs
Get RestroPress

Action

rpress_reservation_admin_save

Updated
On this page

Fires when the reservation details box is saved, so extensions can store their fields.

Runs in rpress_reservation_save_details() after the nonce and capability checks and before status changes and notifications. The raw array holds the unslashed rpress_res[] values from the form; sanitize them before saving.

Available since RestroPress 3.5.

Parameters#

ParameterTypeDescription
$post_idintReservation ID.
$rawarrayUnslashed rpress_res[] values.

Example#

function my_reservation_save( $post_id, $raw ) {
	if ( isset( $raw['occasion'] ) ) {
		update_post_meta( $post_id, 'my_occasion', sanitize_text_field( $raw['occasion'] ) );
	}
}
add_action( 'rpress_reservation_admin_save', 'my_reservation_save', 10, 2 );

Source#

Fired from:

  • includes/features/reservations/admin.php (line 607), in rpress_reservation_save_details()

See also#

Was this page helpful?