Skip to content

Instantly share code, notes, and snippets.

@kartikparmar
Created July 28, 2022 18:38
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/32aa449b6b157fb316ce02c7fc0cfc26 to your computer and use it in GitHub Desktop.
Save kartikparmar/32aa449b6b157fb316ce02c7fc0cfc26 to your computer and use it in GitHub Desktop.
Hide Booking Meta Box on the wcfm product page.
<?php
add_action( 'after_wcfm_products_manage', function( $product_id ) {
?>
<script type="text/javascript">
jQuery( document ).ready( function( $ ) {
function bkap_hide_booking_metabox() {
let product_type = $( '#product_type' ).val();
let allowed_type = [ 'simple'/* , 'variable', 'subscription','variable-subscription' */ ];
if ( jQuery.inArray( product_type, allowed_type ) == -1 ) {
jQuery( '.bkap-booking' ).hide(); // Hide Booking Heading.
jQuery( '.products_manage_bkap_bookings' ).hide(); // Hide Booking meta box.
}
}
bkap_hide_booking_metabox();
});
</script>
<?php
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment