June 14, 2016
Add one of these snippets to functions.php if you’d like to customize your WooCommerce product content.
Update the tab “Product Description” to be the name of the current product:
// 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; }
Sourced here.
Here is my customization on the above. Use this to insert a custom title in place of the “Product Description” text, relevant to the type of Products you are selling:
// change woocommerce product description title 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'] = 'Book Description'; return $tabs; }