Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Frontend Snippets][Editing product data tabs] Add a custom tab
/**
* Add a custom product data tab
*/
add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' );
function woo_new_product_tab( $tabs ) {
// Adds the new tab
$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() {
// The new tab content
echo '<h2>New Product Tab</h2>';
echo '<p>Here\'s your new product tab.</p>';
}
@salomyd

This comment has been minimized.

Copy link

@salomyd salomyd commented Apr 10, 2020

Hello !
Do you have any idea how to apply the new tab created only to a specific language ?
I'd like to have the tab translated in English and French for now, it applies to both languages in French..

Thanks !

@Driteroi

This comment has been minimized.

Copy link

@Driteroi Driteroi commented Jul 7, 2020

Hello @salomyd, did you find any solution? I have same problem.

@makerror

This comment has been minimized.

Copy link

@makerror makerror commented Aug 18, 2020

this will have same content on every product. how to get individual content on products?

@shananza144

This comment has been minimized.

Copy link

@shananza144 shananza144 commented Nov 4, 2020

Second what @makerror says! How to pull content from individual products?

@xewonder

This comment has been minimized.

Copy link

@xewonder xewonder commented Feb 2, 2021

this will have same content on every product. how to get individual content on products?

Yes! I need the same. Please help

@salomyd

This comment has been minimized.

Copy link

@salomyd salomyd commented Feb 3, 2021

Hello @salomyd, did you find any solution? I have same problem.

No sorry, no solution found.. I changed theme

@xewonder

This comment has been minimized.

Copy link

@xewonder xewonder commented Feb 3, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment