Last active
October 18, 2021 03:35
-
-
Save yuliyang/1289b430ef9141d4d71ea86df0b06f04 to your computer and use it in GitHub Desktop.
[WooCommerce] Add/Rename Product Tabs
This file contains hidden or 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 | |
// Add product tabs | |
add_filter( 'woocommerce_product_tabs', 'ching_woo_new_tab' ); | |
function ching_woo_new_tab( $tabs ) { | |
// rename description tab title | |
$tabs['description']['title'] = __( '商品特色' ); | |
// add the new tab - specs | |
$tabs['specs'] = array( | |
'title' => __( '商品規格', 'woocommerce' ), | |
'priority' => 20, | |
'callback' => 'ching_woo_new_tab_content' | |
); | |
return $tabs; | |
} | |
// The new tab content | |
function ching_woo_new_tab_content() { | |
echo '<div class="content">'; | |
echo 'Hi!'; | |
echo '</div>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment