# Booking form fields - unset

**URL:** <https://community.hivepress.io/t/booking-form-fields-unset/5354>\
**Category:** HivePress\
**Created:** [April 15, 2023, 12:48pm UTC](https://community.hivepress.io/t/booking-form-fields-unset/5354 "2023-04-15T12:48:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Munchies4U](https://community.hivepress.io/user_avatar/community.hivepress.io/munchies4u/32/5975_2.png) [@Munchies4U](https://community.hivepress.io/u/Munchies4U)\
**Post date:** [April 15, 2023, 12:48pm UTC](https://community.hivepress.io/t/booking-form-fields-unset/5354/1 "2023-04-15T12:48:21Z")

</div>

Hi there HivePress Team

We’ve enabled time based booking as we require the booking days and unset some of the not required fields with a code snippet

```auto
*add_filter(*
*	'hivepress/v1/forms/listing_update',*
*	function( $form ) {*
* unset( $form['fields']['booking_window'] );*
* unset( $form['fields']['booking_min_time'] );*
* unset( $form['fields']['booking_max_time'] );*
* unset( $form['fields']['booking_min_quantity'] );*
* unset( $form['fields']['booking_max_quantity'] );*
* unset( $form['fields']['booking_slot_duration'] );*
* unset( $form['fields']['booking_slot_interval'] );*
* unset( $form['fields']['booking_moderated']);*
* //unset( $form['fields']['booking_min_length'] );*
* //unset( $form['fields']['booking_max_length'] );*
* return $form;*
*	},*
*	1000*
*);*

```

That’s all working on the Add Listing page, however when making a booking with the hp-form–booking-make form, the user still need to set a time as the \_time filed is shown on the form.

We’ve tried unsetting the field by modifying the snippet used above on the listing\_update form but its not unsetting the filed.

This is the snippet we modified:

```auto
*add_filter(*
*	'hivepress/v1/forms/booking-make',*
*	function( $form ) {*
* unset( $form['fields']['_time'] );*
* return $form;*
*	},*
*	1000*
*);*

```

Please assist.

---

<div class="post-metadata">

**Author:** ![ihor](https://community.hivepress.io/user_avatar/community.hivepress.io/ihor/32/5_2.png) [@ihor](https://community.hivepress.io/u/ihor)\
**Post date:** [April 16, 2023, 10:35am UTC](https://community.hivepress.io/t/booking-form-fields-unset/5354/2 "2023-04-16T10:35:51Z")

</div>

Please try using this hook for the second snippet:

`hivepress/v1/forms/booking_update`

Note that this may require further customizations, the snippet may not work in this case because bookings require start/end time in any case.

---

<div class="post-metadata">

**Author:** ![Munchies4U](https://community.hivepress.io/user_avatar/community.hivepress.io/munchies4u/32/5975_2.png) [@Munchies4U](https://community.hivepress.io/u/Munchies4U)\
**Post date:** [April 16, 2023, 11:37am UTC](https://community.hivepress.io/t/booking-form-fields-unset/5354/3 "2023-04-16T11:37:04Z")

</div>

Thanks for the reply Hp Team (Ihor)

The form name we were using turns out to have been the correct one, just without the typo in the form name.  
We should have been using underscore (booking\_make) instead of the dash (booking-make).

A late night it must have been. 😉

---

<div class="post-metadata">

**Author:** ![system](https://community.hivepress.io/user_avatar/community.hivepress.io/system/32/13990_2.png) [@system](https://community.hivepress.io/u/system)\
**Post date:** [May 16, 2023, 11:37am UTC](https://community.hivepress.io/t/booking-form-fields-unset/5354/4 "2023-05-16T11:37:45Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
