Action
rpress_reservation_form_after_time
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#
| Parameter | Type | Description |
|---|---|---|
$values | array | Submitted values when the form is shown again after an error. |
$errors | WP_Error | Field errors keyed by field name. |
$date | string | Selected date (Y-m-d). |
$party | int | Selected 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), inrpress_reservation_shortcode()
See also#
Was this page helpful?
