Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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