-
-
Save jameskoster/5133515 to your computer and use it in GitHub Desktop.
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; | |
} |
as @admench define $post (change it to $product as you are using woo products)
`
/========= Rename Tabs============/
add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
function woo_rename_tabs( $tabs ) {
global $product, $post;
if ( $product->post_content ) {
$tabs['description']['title'] = __( 'Description' ); // Rename the description tab
$tabs['reviews']['title'] = __( 'Ratings' ); // Rename the reviews tab
$tabs['additional_information']['title'] = __( 'Specification' ); // Rename the additional information tab
}
return $tabs;
}
`
Solved my Problem. added an if condition either $product has the content of these tabs.
Guys, I was in this big mess with a page friend. She disabled whatever tab she want and gave me the warning. The problem was that the function was expecting something but it was disable. This worked for me.
`add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
function woo_rename_tabs( $tabs ) {
if ( $tabs['description'] ) {
$tabs['description']['title'] = __( 'Descripción' );
}
if($tabs['reviews']){
$tabs['reviews']['title'] = __( 'Calificaciones' );
}
if( $tabs['additional_information'] ) {
$tabs['additional_information']['title'] = __( 'Información adicional' );
}
return $tabs;
}`
Hello all,
This great works for me in changing the tab name but it does not alter the Discription text just below it, just above the text from the product page. Please see picture if im not that clear. http://i204.photobucket.com/albums/bb44/ClassicMullet/discription%202_zps1rjiksnu.png
Im pretty new to all this so please bear with me. Thanks!
Should be something like