# How can I set a default value for a listing attribute and hide it from listing creation

**URL:** <https://community.hivepress.io/t/how-can-i-set-a-default-value-for-a-listing-attribute-and-hide-it-from-listing-creation/1411>\
**Category:** Bookings\
**Tags:** code\
**Created:** [August 21, 2022, 1:04pm UTC](https://community.hivepress.io/t/how-can-i-set-a-default-value-for-a-listing-attribute-and-hide-it-from-listing-creation/1411 "2022-08-21T13:04:13Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![tomp](https://community.hivepress.io/user_avatar/community.hivepress.io/tomp/32/4558_2.png) [@tomp](https://community.hivepress.io/u/tomp)\
**Post date:** [August 22, 2022, 5:02pm UTC](https://community.hivepress.io/t/how-can-i-set-a-default-value-for-a-listing-attribute-and-hide-it-from-listing-creation/1411/8 "2022-08-22T17:02:58Z")

</div>

I found the issue with the filter! It was missing the ,1000 at the end of the filter

```auto

add_action('hivepress/v1/models/listing/create', function($listing_id) {
	if(hivepress()->get_version( 'bookings' )){
		update_post_meta($listing_id, 'hp_booking_slot_duration', 10);
		update_post_meta($listing_id, 'hp_booking_min_time', 0);
		update_post_meta($listing_id, 'hp_booking_max_time', 0);
		update_post_meta($listing_id, 'hp_booking_slot_interval', 10);
		update_post_meta($listing_id, 'hp_booking_moderated', true);	
	}
});

add_filter(
	'hivepress/v1/models/listing/attributes',
	function( $attributes ) {
		if ( isset($attributes['booking_slot_duration']) ) {
			$attributes['booking_slot_duration']['editable'] = false;
		}
		
		if ( isset($attributes['booking_min_time']) ) {
			$attributes['booking_min_time']['editable'] = false;
		}
		
		if ( isset($attributes['booking_max_time']) ) {
			$attributes['booking_max_time']['editable'] = false;
		}
		
		if ( isset($attributes['booking_slot_interval']) ) {
			$attributes['booking_slot_interval']['editable'] = false;
		}
		
		if ( isset($attributes['booking_moderated']) ) {
			$attributes['booking_moderated']['editable'] = false;
		}

		return $attributes;
	},
	1000
);

```

Thank you for all the help,  
Tom

---

_[View the full topic](https://community.hivepress.io/t/how-can-i-set-a-default-value-for-a-listing-attribute-and-hide-it-from-listing-creation/1411)._
