Filter
rpress_reservation_submit_data
On this page
Filters the reservation data read from the submitted form.
Runs in rpress_reservation_handle_submit() after the core fields (date, slot, party, name, phone, email, note) are read from the posted form and cast to strings. Extensions use it to add their own posted fields; the full posted data is available as $input, and it is later passed on to rpress_reservation_validation_errors and rpress_reservation_insert_meta. Core fields are sanitized by the validation step, so values added here must be sanitized by the callback.
Available since RestroPress 3.5.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$data | array | Core fields as strings: date, slot, party, name, phone, email and note. |
$input | array | Raw unslashed $_POST. |
Return value#
array. The reservation data to validate and store.
Example#
function my_reservation_submit_data( $data, $input ) {
$data['occasion'] = isset( $input['my_occasion'] ) ? sanitize_text_field( $input['my_occasion'] ) : '';
return $data;
}
add_filter( 'rpress_reservation_submit_data', 'my_reservation_submit_data', 10, 2 );
Source#
Applied in:
includes/features/reservations/frontend.php(line 174), inrpress_reservation_handle_submit()
See also#
Was this page helpful?
