Skip to content
Docs
Get RestroPress

Action

rpress_reservation_form_after_time

Updated
On this page

Fires after the date, guests and time fields of the reservation form.

Runs while the [rpress_reservation] form is rendered, after the date, guests and time selectors and before the name field. Use it to print extra fields such as a table picker. Posted values can be read in the rpress_reservation_submit_data filter.

Available since RestroPress 3.5.

Parameters#

ParameterTypeDescription
$valuesarraySubmitted values when the form is shown again after an error.
$errorsWP_ErrorField errors keyed by field name.
$datestringSelected date (Y-m-d).
$partyintSelected party size.

Example#

function my_reservation_seating_field( $values, $errors, $date, $party ) {
	$selected = isset( $values['my_seating'] ) ? $values['my_seating'] : 'indoor';
	echo '<p class="rpress-res-field"><label for="my-seating">Seating</label>';
	echo '<select id="my-seating" name="my_seating">';
	echo '<option value="indoor"' . selected( $selected, 'indoor', false ) . '>Indoor</option>';
	echo '<option value="outdoor"' . selected( $selected, 'outdoor', false ) . '>Outdoor</option>';
	echo '</select></p>';
}
add_action( 'rpress_reservation_form_after_time', 'my_reservation_seating_field', 10, 4 );

Notes#

$values only contains the core fields unless an extension adds its own through rpress_reservation_submit_data.

Source#

Fired from:

  • includes/features/reservations/frontend.php (line 416), in rpress_reservation_shortcode()

See also#

Was this page helpful?