Skip to content

Instantly share code, notes, and snippets.

@kartikparmar
Created May 30, 2022 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kartikparmar/4ee626ed9fce2eeb65f14e8eab25afc1 to your computer and use it in GitHub Desktop.
Save kartikparmar/4ee626ed9fce2eeb65f14e8eab25afc1 to your computer and use it in GitHub Desktop.
Enable Booking Option and Inline Calendar on front end.
<?php
function bkap_booking_default_settings() {
?>
<script>
jQuery( document ).ready( function ( $ ) {
if ( jQuery('#bkap-booking-type' ).length > 0 ) {
// Enable Booking.
jQuery('#booking_enable_date').prop( 'checked', true );
// Enabling Inline Calendar
jQuery('#enable_inline_calendar').prop( 'checked', true );
}
});
</script>
<?php
}
add_action( 'wp_print_scripts', 'bkap_booking_default_settings' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment