Created
November 16, 2020 04:07
-
-
Save DeveloperWil/8aafd96c7999d997dd8ecbea0bfdac19 to your computer and use it in GitHub Desktop.
WooCommerce: Rename Product Tabs
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
/** | |
* 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