Skip to content

Instantly share code, notes, and snippets.

@wbcomdev
Created May 13, 2021 04:49
Show Gist options
  • Select an option

  • Save wbcomdev/3b22d435cfeeec34a50600ef56d28318 to your computer and use it in GitHub Desktop.

Select an option

Save wbcomdev/3b22d435cfeeec34a50600ef56d28318 to your computer and use it in GitHub Desktop.
/**
* Add a custom product data tab.
*/
function wb_woo_new_product_tab( $tabs ) {
// Adds the new tab.
$tabs['test_tab'] = array(
'title' => __( 'New Product Tab', 'woocommerce' ),
'priority' => 50,
'callback' => 'wb_woo_new_product_tab_content',
);
return $tabs;
}
/**
* Custom product data tab content.
*/
function wb_woo_new_product_tab_content() {
// The new tab content.
echo '<h2>New Product Tab</h2>';
echo '<p>Here\'s your new product tab.</p>';
}
add_filter( 'woocommerce_product_tabs', 'wb_woo_new_product_tab' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment