woocommerce/templates/single-product/tabs/tabs.php

49 lines
1.6 KiB
PHP
Raw Normal View History

2011-12-09 20:16:34 +00:00
<?php
/**
2015-11-03 13:53:50 +00:00
* Single Product tabs
2012-08-14 18:05:45 +00:00
*
2015-11-03 13:31:20 +00:00
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/tabs/tabs.php.
*
2016-02-12 11:28:41 +00:00
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
2016-02-12 11:28:41 +00:00
* @see http://docs.woothemes.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.4.0
2011-12-09 20:16:34 +00:00
*/
2012-04-03 09:34:02 +00:00
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
2015-11-03 13:31:20 +00:00
* Filter tabs and allow third parties to add their own.
*
2013-02-10 18:49:22 +00:00
* Each tab is an array containing title, callback and priority.
* @see woocommerce_default_product_tabs()
*/
$tabs = apply_filters( 'woocommerce_product_tabs', array() );
2012-04-03 09:34:02 +00:00
if ( ! empty( $tabs ) ) : ?>
<div class="woocommerce-tabs wc-tabs-wrapper">
<ul class="tabs wc-tabs">
<?php foreach ( $tabs as $key => $tab ) : ?>
<li class="<?php echo esc_attr( $key ); ?>_tab">
<a href="#tab-<?php echo esc_attr( $key ); ?>"><?php echo apply_filters( 'woocommerce_product_' . $key . '_tab_title', esc_html( $tab['title'] ), $key ); ?></a>
</li>
<?php endforeach; ?>
2012-04-03 09:34:02 +00:00
</ul>
<?php foreach ( $tabs as $key => $tab ) : ?>
<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 ); ?>">
<?php call_user_func( $tab['callback'], $key, $tab ); ?>
</div>
<?php endforeach; ?>
2012-04-03 09:34:02 +00:00
</div>
<?php endif; ?>