add below code to theme/functions.php
/*
WooCommerce添加自定义选项卡
代码来源: www.wpzhinan.com
*/
add_filter( 'woocommerce_product_tabs', 'wc_add_features_tab' );
function wc_add_features_tab( $tabs ){
global $product;
$content = get_post_meta( $product->id, 'product_features', true );
if( !empty($content) ) {
$tabs[ 'features' ] = array(
'title' => 'Features', //标签名
'priority' => 1,
'callback' => 'wc_features_tabs_panel_content',
'content' => $content, // custom field
);
}
return $tabs;
}
function wc_features_tabs_panel_content( $key, $tab ){
echo '
' . $tab['title'] . '
';
echo $tab['content'];
}
Source:
http://www.wpzhinan.com/jiaocheng/456.html

