add_filter( 'woocommerce_product_tabs', 'bbloomer_add_product_tab', 9999 );
function bbloomer_add_product_tab( $tabs ) {
$tabs['docs'] = array(
'title' => __( 'Docs', 'woocommerce' ), // TAB TITLE
'priority' => 50, // TAB SORTING (DESC 10, ADD INFO 20, REVIEWS 30)
'callback' => 'bbloomer_docs_product_tab_content', // TAB CONTENT CALLBACK
);
return $tabs;
}
function bbloomer_docs_product_tab_content() {
global $product;
echo 'Whatever content for ' . $product->get_name();
}
Woocommerce single product hook + Add new custom tab
- In WooCommerce
- 140 |
- 0