Add Extra Tabs on WooCommerce Products - WP Beaches
Wed Nov 17 2021 22:30:41 GMT+0000 (Coordinated Universal Time)
Saved by
@khalidlogi
add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' );
/**
* Add 2 custom product data tabs
*/
function woo_new_product_tab( $tabs ) {
// Adds the new tab
if(get_field('ska_ingredients'))
$tabs['ingredient_tab'] = array(
'title' => __( 'Ingredients', 'woocommerce' ),
'priority' => 15,
'callback' => 'ska_ingredients_callback'
);
if(get_field('ska_works'))
$tabs['work_tab'] = array(
'title' => __( 'How To Use', 'woocommerce' ),
'priority' => 15,
'callback' => 'ska_works_callback'
);
return $tabs;
}
content_copyCOPY
https://wpbeaches.com/add-extra-tabs-on-woocommerce-products/
Comments