Last active
July 5, 2019 05:57
-
-
Save imran-khan1/56989a9f4e4639a13b07c9d4a833e342 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 | |
/** | |
* Add the custom tab | |
*/ | |
function woo_custom_product_tab( $tabs ) { | |
$tabs['my_custom_tab'] = array( | |
'title' => __( 'Custom Tab', 'textdomain' ), | |
'callback' => 'woo_custom_tab_content', | |
'priority' => 50, | |
); | |
return $tabs; | |
} | |
add_filter( 'woocommerce_product_tabs', 'woo_custom_product_tab' ); | |
/** | |
* // The custom tab content | |
*/ | |
function woo_custom_tab_content( $slug, $tab ) { | |
?><h2><?php echo wp_kses_post( $tab['title'] ); ?></h2> | |
<p>Tab Content</p><?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment