-
-
Save tittee/8cd68dfbc45ab58403280ad0edad337d to your computer and use it in GitHub Desktop.
WooCommerce Change Description Tab title and heading to product title
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
<?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; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment