Last active
July 5, 2019 05:34
-
-
Save imran-khan1/bd2dd69c3e37fed94490db0856f23bfc to your computer and use it in GitHub Desktop.
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 | |
function woo_custom_physical_product_tab( $tabs ) { | |
global $product; | |
// Ensure it doesn't show for virtual products | |
if ( ! $product->is_virtual() ) { | |
$tabs['shipping'] = array( | |
'title' => __( 'Shipping', 'textdomain' ), | |
'callback' => 'woo_custom_shipping_tab', | |
'priority' => 50, | |
); | |
} | |
return $tabs; | |
} | |
add_filter( 'woocommerce_product_tabs', 'my_custom_physical_product_tab' ); | |
/** | |
* Function that displays output for the shipping tab. | |
*/ | |
function woo_custom_shipping_tab( $slug, $tab ) { | |
?><h2><?php echo wp_kses_post( $tab['title'] ); ?></h2> | |
<p>This tab contains shipping information</p><?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment