Created
November 15, 2023 14:24
-
-
Save LaxusCroco/347713721206d26bb033c2e03ddafd6a to your computer and use it in GitHub Desktop.
Allow bookings only in the current year
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_action( 'wp_head', function () { ?> | |
<script> | |
jQuery( document ).on( 'jet-booking/init', () => { | |
window.jetBookingState.filters.add( "jet-booking/input/config", modifyBookingConfig ); | |
window.jetBookingState.filters.add( "jet-booking/calendar/config", modifyBookingConfig ); | |
function modifyBookingConfig( config ) { | |
config.endDate = new Date().getFullYear()+'-12-31'; | |
return config; | |
} | |
} ); | |
</script> | |
<?php } ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment