How to make "booking days" mandatory?

When I click on “list a property”, I need to choose “booking days” but it is currently optional. How do I make the “booking days” option mandatory?

Please keep in mind that I have the following:

  • RentalHive
  • Hivepress Version 1.6.16
  • Hivepress Blocks Version 1.0.0
  • Hivepress Bookings Version 1.4.11
  • Hivepress Favourites Version 1.2.2
  • Hivepress Geolocation Version 1.3.7
  • Hivepress Marketplace Version 1.3.7
  • Hivepress Messages Version 1.3.0
  • Hivepress Reviews Version 1.3.0
  • Hivepress Social Login Version 1.0.1

Hi,
Please try this PHP snippet:

add_filter(
	'hivepress/v1/forms/listing_update',
	function( $form ) {
		if(isset($form['fields']['booking_days'])){
		  $form['fields']['booking_days']['required'] = true;
		}

		return $form;
	},
	1000
);
1 Like

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