Skip to content

Instantly share code, notes, and snippets.

@kartikparmar
Last active May 9, 2022 14:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kartikparmar/4422a6f1d0aa4781622dd89e316d4b3b to your computer and use it in GitHub Desktop.
<?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