Skip to content

Instantly share code, notes, and snippets.

@imran-khan1
Last active July 5, 2019 05:57
Show Gist options
  • Save imran-khan1/56989a9f4e4639a13b07c9d4a833e342 to your computer and use it in GitHub Desktop.
Save imran-khan1/56989a9f4e4639a13b07c9d4a833e342 to your computer and use it in GitHub Desktop.
<?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