Join our new community forum for support & discussion

Join Now

Home Support Themes RentalHive Edit default attributes

Edit default attributes

  • Author
    Posts
  • Francisco Bolado

    Hello,

    I am editing the Theme Rentalhive for my web. I would like to edit or delete some of the attibutes that the theme has by default such as “Booking offset”, “Booking window”…etc. Could you please indicate how can I edit those?

    Thanks

    ihor developer

    Hi,
    These fields are built-in (added by the Bookings extension), but it’s possible to hide optional fields with a simple code snippet. Please list the fields you want to hide and I’ll post the snippet.

    yourwp.site

    I have the same question and want to hide!
    – BOOKING OFFSET
    – BOOKING WINDOW
    – BOOKING SLOT INTERVAL
    – BOOKING REQUESTS (Manually accept new bookings) – I want to be automatic.

    Thank you and hope you don`t mind with de caps lock, it was copy and paste from the site…

    tajutondarra

    Same with me, I would need to hide some optional fields in Booking extension

    – BOOKING OFFSET (OPTIONAL)
    – BOOKING WINDOW (OPTIONAL)
    – BOOKING SLOT INTERVAL (OPTIONAL)

    And also sorry for caps 🙂

    yevhen developer

    Please try this PHP snippet

    add_filter(
    	'hivepress/v1/models/listing/attributes',
    	function( $attributes ) {
    		if ( isset( $attributes['booking_offset'],  $attributes['booking_window'], $attributes['booking_slot_interval'], $attributes['booking_moderated']) ) {
    			// Hide Booking Offset.
    			$attributes['booking_offset']['editable'] = false;
    			
    			// Hide Booking Window.
    			$attributes['booking_window']['editable'] = false;
    			
    			// Hide Slot Interval.
    			$attributes['booking_slot_interval']['editable'] = false;
    			
    			// Hide Booking Requests.
    			$attributes['booking_moderated']['editable'] = false; 
    		}
     
    		return $attributes;
    	},
    	1000
    );
    tajutondarra

    That worked! Thank you so much 🙂

Viewing 6 posts - 1 through 6 (of 6 total)

New Reply

This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.