Last active
May 31, 2021 13:06
-
-
Save woogists/c15230393ba094d9da33a19a02e20a15 to your computer and use it in GitHub Desktop.
[Frontend Snippets][Editing product data tabs] Add a custom tab
This file contains 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
/** | |
* 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>'; | |
} |
Hello @salomyd, did you find any solution? I have same problem.
this will have same content on every product. how to get individual content on products?
Second what @makerror says! How to pull content from individual products?
this will have same content on every product. how to get individual content on products?
Yes! I need the same. Please help
Hello @salomyd, did you find any solution? I have same problem.
No sorry, no solution found.. I changed theme
i found a a plugin that does exaclt what i want!
all the time wasted... for $24!!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 !