Created
December 20, 2023 13:34
-
-
Save Crocoblock/9e38f625881fcbaa079cfc363114bd3d to your computer and use it in GitHub Desktop.
JetAppointment Exclude not full-duration slots
This file contains hidden or 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 | |
add_filter( 'jet-apb/time-slots/slots-html/slots-list', function( $slots, $format, $dataset, $date, $service, $provider ) { | |
$duration = jet_apb()->calendar->get_schedule_settings( $provider, $service, null, 'default_slot' ); | |
foreach ( $slots as $time => $slot ) { | |
if ( $slot['to'] - $slot['from'] < $duration ) { | |
unset( $slots[ $time ] ); | |
} | |
} | |
return $slots; | |
}, 0, 6 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment