Skip to content

Instantly share code, notes, and snippets.

@DeveloperWil
Created November 16, 2020 04:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DeveloperWil/8aafd96c7999d997dd8ecbea0bfdac19 to your computer and use it in GitHub Desktop.
Save DeveloperWil/8aafd96c7999d997dd8ecbea0bfdac19 to your computer and use it in GitHub Desktop.
WooCommerce: Rename Product Tabs
/**
* Rename the default WooCommerce product tabs
*
* @author Wil Brown zeropointdevelopment.com
* @param $tabs
* @return mixed
*/
function zpd_wc_rename_product_tabs($tabs) {
global $post;
$tabs['description']['title'] = 'Product Info';
$tabs['additional_information']['title'] = 'More Info';
// Get the number of comments (reviews)
$comments_count = wp_count_comments( $post->ID );
$tabs['reviews']['title'] = 'What People Think ⭐⭐⭐⭐⭐ (' . $comments_count->approved . ')';
return $tabs;
}
add_filter( 'woocommerce_product_tabs', 'zpd_wc_rename_product_tabs', 10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment