Created
March 9, 2018 16:27
-
-
Save woogists/96fa3e8afda6fb73ca3536313fe88bfc to your computer and use it in GitHub Desktop.
[WooCommerce Bookings] - Product Dependencies
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
/** | |
* Will make it so the Dependencies tab shows on a Bookable product. | |
* | |
* @param array $tabs The list of tabs in a product's settings. | |
*/ | |
function add_bookable_product_to_dependencies( $tabs ) { | |
// Check to see if the class exists and if the tab is set. | |
if ( class_exists( 'WC_Product_Dependencies' ) && isset( $tabs['dependencies'] ) ) { | |
// If so, add our class for the JS hooks. | |
$tabs['dependencies']['class'][] = 'show_if_booking'; | |
} | |
return $tabs; | |
} | |
add_filter( 'woocommerce_product_data_tabs', 'add_bookable_product_to_dependencies', 999 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment