Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Yeadh/bcaa8392639d892fba94b9bbb9f5ed5f to your computer and use it in GitHub Desktop.
Save Yeadh/bcaa8392639d892fba94b9bbb9f5ed5f to your computer and use it in GitHub Desktop.
add_filter( 'woocommerce_product_tabs', 'woo_product_tab', 98 );
function woo_product_tab( $tabs ) {
// print_r( $tabs );
$tabs['additional_information']['title']="ASSEMBLY";
$tabs['description']['priority']=10;
$tabs['videos']['priority']=25;
$tabs['additional_information']['priority']=15;
$tabs['additional_information']['callback']="my_custom_callback_tab";
// adding custom tab
$tabs['my_custom_tab'] = array(
'title' => "CAD Download",
'priority' => 20,
'callback' => 'my_custom_tab',
);
return $tabs;
}
function my_custom_tab(){
?>
<p> <a href="<?php echo get_field('prod_download1'); ?>"><?php echo get_field('file_download1_label'); ?></a> </p>
<?php
?>
<p> <a href="<?php echo get_field('prod_download2'); ?>"><?php echo get_field('file_download2_label'); ?></a> </p>
<?php
?>
<p> <a href="<?php echo get_field('prod_download3'); ?>"><?php echo get_field('file_download3_label'); ?></a> </p>
<?php
}
function my_custom_callback_tab(){
echo get_field('prod_description3');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment