tabs.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * Single Product tabs
  4. *
  5. * This template can be overridden by copying it to yourtheme/woocommerce/single-product/tabs/tabs.php.
  6. *
  7. * HOWEVER, on occasion WooCommerce will need to update template files and you
  8. * (the theme developer) will need to copy the new files to your theme to
  9. * maintain compatibility. We try to do this as little as possible, but it does
  10. * happen. When this occurs the version of the template file will be bumped and
  11. * the readme will list any important changes.
  12. *
  13. * @see https://docs.woocommerce.com/document/template-structure/
  14. * @author WooThemes
  15. * @package WooCommerce/Templates
  16. * @version 2.4.0
  17. */
  18. if ( ! defined( 'ABSPATH' ) ) {
  19. exit;
  20. }
  21. /**
  22. * Filter tabs and allow third parties to add their own.
  23. *
  24. * Each tab is an array containing title, callback and priority.
  25. * @see woocommerce_default_product_tabs()
  26. */
  27. $tabs = apply_filters( 'woocommerce_product_tabs', array() );
  28. if ( ! empty( $tabs ) ) : ?>
  29. <div class="woocommerce-tabs wc-tabs-wrapper limit-wrapper vamtam-box-outer-padding">
  30. <ul class="tabs wc-tabs" role="tablist">
  31. <?php foreach ( $tabs as $key => $tab ) : ?>
  32. <li class="<?php echo esc_attr( $key ); ?>_tab" id="tab-title-<?php echo esc_attr( $key ); ?>" role="tab" aria-controls="tab-<?php echo esc_attr( $key ); ?>">
  33. <a href="#tab-<?php echo esc_attr( $key ); ?>"><?php echo apply_filters( 'woocommerce_product_' . $key . '_tab_title', esc_html( $tab['title'] ), $key ); ?></a>
  34. </li>
  35. <?php endforeach; ?>
  36. </ul>
  37. <?php foreach ( $tabs as $key => $tab ) : ?>
  38. <div class="woocommerce-Tabs-panel woocommerce-Tabs-panel--<?php echo esc_attr( $key ); ?> panel entry-content wc-tab" id="tab-<?php echo esc_attr( $key ); ?>" role="tabpanel" aria-labelledby="tab-title-<?php echo esc_attr( $key ); ?>">
  39. <?php if ( isset( $tab['callback'] ) ) { call_user_func( $tab['callback'], $key, $tab ); } ?>
  40. </div>
  41. <?php endforeach; ?>
  42. </div>
  43. <?php endif; ?>