Hide or adjust the listing form fields

Hi!
Some questions, (I have preferred to ask everything in the same topic and not create several):

1- How do I get that in the list a property menu, the option “maximum booking duration” by default be always “1”.
2- I don’t want the fields: “maximum booking duration”, “minimun booking duration”, “booking window”, “Set how many days are required prior to the booking date” and “BOOKING REQUEST” title appears. It´s possible?
3- The “Images” field comes with “optional” by default, how can I remove it? and how can I put a description in the “Title” field?

Thanks

  1. Please try this PHP snippet
add_action('hivepress/v1/models/listing/create', function($listing_id) {
	update_post_meta($listing_id, 'hp_booking_max_length', 1);
});
  1. Please try this PHP snippet to start. In the same way, it is possible to remove other fields Hide the booking offset and window fields in the listing form #hivepress #bookings · GitHub

  2. Please try this PHP snippet to make Images field required for listings Require uploading at least one image for listings #hivepress #listings · GitHub

  3. Please try this PHP snippet

add_filter(
	'hivepress/v1/forms/listing_update',
	function( $form ) {
		if(isset($form['fields']['title'])){
		  $form['fields']['title']['description'] = 'custom text here';
		}

		return $form;
	},
	1000
);

1- How do I get that in the list a property menu, the option “maximum booking duration” by default be always “1”.

DONE

2- I don’t want the fields: “maximum booking duration”, “minimun booking duration”, “booking window”, “Set how many days are required prior to the booking date” and “BOOKING REQUEST” title appears. It´s possible?

I can´t remove it (I attached a screenshot)

3- The “Images” field comes with “optional” by default, how can I remove it? and how can I put a description in the “Title” field?

I only can change location and images field, but maximum guests and price I can´t, probably is not the same way to do it… (I attached a screenshot)

  1. Please try this PHP snippet
add_filter(
	'hivepress/v1/forms/listing_update',
	function( $form ) {
		unset( $form['fields']['booking_min_length'] );
		unset( $form['fields']['booking_offset'] );
		unset( $form['fields']['booking_window'] );
		unset( $form['fields']['booking_max_length'] );
		unset( $form['fields']['booking_moderated'] );

		return $form;
	},
	1000
);
  1. Please try this PHP snippet for location and price fields
add_filter(
	'hivepress/v1/forms/listing_update',
	function( $form ) {
		if(isset($form['fields']['price'])){
		  $form['fields']['price']['description'] = 'custom text here';
		}
		
		if(isset($form['fields']['location'])){
		  $form['fields']['location']['description'] = 'custom text here';
		}

		return $form;
	},
	1000
);
  1. DONE
  2. Location alredy worked, but price fields remains unchanged

If it is a custom Price listing attribute, then please check its field name in the Listings/Attributes and change the price word in the code snippet on the field name of this attribute

That was the problem. my fault.
Thanks!

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