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

40 lines
1014 B
PHP
Raw Normal View History

2011-12-09 20:16:34 +00:00
<?php
/**
2012-08-14 18:05:45 +00:00
* Single Product tabs
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.0.0
2011-12-09 20:16:34 +00:00
*/
2012-04-03 09:34:02 +00:00
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* 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 $key ?>_tab">
<a href="#tab-<?php echo $key ?>"><?php echo apply_filters( 'woocommerce_product_' . $key . '_tab_title', $tab['title'], $key ) ?></a>
</li>
<?php endforeach; ?>
2012-04-03 09:34:02 +00:00
</ul>
<?php foreach ( $tabs as $key => $tab ) : ?>
<div class="panel entry-content wc-tab" id="tab-<?php echo $key ?>">
<?php call_user_func( $tab['callback'], $key, $tab ) ?>
</div>
<?php endforeach; ?>
2012-04-03 09:34:02 +00:00
</div>
<?php endif; ?>