Givilo
June 12, 2023, 2:10am
1
Hello,
I’ve tried the snippet below to atomatically check “Manually accept new booking” and hide it, but it only hides that option but does not check it. Instead of “Request to book” it still shows “Book now”. I’ve tried other snippets from the previous postings, but nothing seems to work.
I would appreciate your help.
Thank you.
add_filter(
'hivepress/v1/models/listing/attributes',
function( $attributes ) {
if ( isset($attributes['booking_moderated']) ) {
$attributes['booking_moderated']['editable'] = false;
}
return $attributes;
},
1000
);
andrii
June 12, 2023, 6:36am
2
Givilo
June 12, 2023, 8:23pm
3
I used the snipped below from the post you are referring to, but did not do anything.
add_filter(
'hivepress/v1/models/listing/attributes',
function( $attributes ) {
if ( isset($attributes['booking_moderated']) ) {
$attributes['booking_moderated']['editable'] = false;
}
return $attributes;
},
1000
);
andrii
June 13, 2023, 8:10am
5
Hi,
You must use these PHP snippets:
Hide the Booking Requests feature:
add_filter(
'hivepress/v1/models/listing/attributes',
function( $attributes ) {
if ( isset($attributes['booking_moderated']) ) {
$attributes['booking_moderated']['editable'] = false;
}
return $attributes;
},
1000
);
And set the Booking Requests by default:
add_action('hivepress/v1/models/listing/create', function($listing_id) {
if(hivepress()->get_version( 'bookings' )){
update_post_meta($listing_id, 'hp_booking_moderated', true);
}
},
1000
);
system
Closed
July 13, 2023, 4:05pm
7
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.