Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WooCommerce Change Description Tab title and heading to product title
<?php
// Change the description tab title to product name
add_filter( 'woocommerce_product_tabs', 'wc_change_product_description_tab_title', 10, 1 );
function wc_change_product_description_tab_title( $tabs ) {
global $post;
if ( isset( $tabs['description']['title'] ) )
$tabs['description']['title'] = $post->post_title;
return $tabs;
}
// Change the description tab heading to product name
add_filter( 'woocommerce_product_description_heading', 'wc_change_product_description_tab_heading', 10, 1 );
function wc_change_product_description_tab_heading( $title ) {
global $post;
return $post->post_title;
}
?>
@newmediologo

This comment has been minimized.

Copy link

@newmediologo newmediologo commented May 3, 2015

Thanks kloon, really useful..:-)

@jarodthornton

This comment has been minimized.

Copy link

@jarodthornton jarodthornton commented Jul 13, 2017

Perfect! Thank you!

@laibamalik

This comment has been minimized.

Copy link

@laibamalik laibamalik commented Jul 17, 2019

hey. i wanted to add a word "WHY" just before product title in the product description tab title. how can i do that i'm trying different methods but nothing is working for me.
any help is appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.