Skip to content

Instantly share code, notes, and snippets.

@woogists
Last active July 5, 2023 22:17
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save woogists/a0e1554b392f5718d6557797a480b9e6 to your computer and use it in GitHub Desktop.
Save woogists/a0e1554b392f5718d6557797a480b9e6 to your computer and use it in GitHub Desktop.
[Frontend Snippets][Editing product data tabs] Renaming product data tabs
/**
* Rename product data tabs
*/
add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
function woo_rename_tabs( $tabs ) {
$tabs['description']['title'] = __( 'More Information' ); // Rename the description tab
$tabs['reviews']['title'] = __( 'Ratings' ); // Rename the reviews tab
$tabs['additional_information']['title'] = __( 'Product Data' ); // Rename the additional information tab
return $tabs;
}
@spectralevolution
Copy link

spectralevolution commented Aug 13, 2021

I'm newer at coding, so I hope this is an easy fix and I'm just being silly, but I am having trouble finding where to change the "h2" element that is auto-generated within the tab. I renamed "Additional Information" to "Product Data" but it still generates the text "Additional Information" in the body of the tab despite the title being changed in the tab itself. Image for clarification.

image

Thanks in advance if anyone can help me.

@ucbpaladin
Copy link

@spectralevolution What you want to do is to change the product tab heading, please take a look at [https://rudrastyh.com/woocommerce/rename-product-tabs-and-heading.html]

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