Skip to content

Instantly share code, notes, and snippets.

@Crocoblock
Created December 20, 2023 13:34
Show Gist options
  • Save Crocoblock/9e38f625881fcbaa079cfc363114bd3d to your computer and use it in GitHub Desktop.
Save Crocoblock/9e38f625881fcbaa079cfc363114bd3d to your computer and use it in GitHub Desktop.
JetAppointment Exclude not full-duration slots
<?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