Last active
May 9, 2022 14:48
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function limit_booking_types( $booking_types ) { | |
if ( is_admin() ) { | |
return $booking_types; | |
} | |
$booking_types = array(); // Clear previous contents of variable. | |
$group_only_days = 'Only Days'; | |
$group_date_time = 'Date & Time'; | |
$group_multi_dates = 'Multiple Dates'; | |
$booking_types['multiple_days'] = array( | |
'key' => 'multiple_days', | |
'label' => __( 'Multiple Nights', 'woocommerce-booking' ), | |
'group' => $group_only_days, | |
); | |
$booking_types['date_time'] = array( | |
'key' => 'date_time', | |
'label' => __( 'Fixed Time', 'woocommerce-booking' ), | |
'group' => $group_date_time, | |
); | |
$booking_types['multidates_fixedtime'] = array( | |
'key' => 'multidates_fixedtime', | |
'label' => __( 'Dates & Fixed Time', 'woocommerce-booking' ), | |
'group' => $group_multi_dates, | |
); | |
return $booking_types; | |
} | |
add_filter( 'bkap_get_booking_types', 'limit_booking_types', 10, 1 ); | |
function bkap_hide_extra_options() { | |
?> | |
<style type="text/css"> | |
.bkap_type_box{ | |
display: none; | |
} | |
</style> | |
<?php | |
} | |
add_action( 'wp_head', 'bkap_hide_extra_options' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment