Search
Close this search box.
Search
Close this search box.

How to edit WooCommerce product data tabs with PHP

How to add a new tab

/**
* Add a custom product data tab
*/

add_filter( ‘woocommerce_product_tabs’, ‘woo_new_product_tab’ );
function woo_new_product_tab( $tabs ) {
$tabs[‘test_tab’] = array(
‘title’ => __( ‘New Product Tab’, ‘woocommerce’ ),
‘priority’ => 50,
‘callback’ => ‘woo_new_product_tab_content’
);

return $tabs;

}
function woo_new_product_tab_content() {
echo ‘<h2>New Product Tab</h2>’;
echo ‘<p>Here\’s your new product tab.</p>’;
}

Learning Resources