Created
July 28, 2022 18:38
-
-
Save kartikparmar/32aa449b6b157fb316ce02c7fc0cfc26 to your computer and use it in GitHub Desktop.
Hide Booking Meta Box on the wcfm product page.
This file contains 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( '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