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

41 lines
1001 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; // Exit if accessed directly
/**
* 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.
2013-11-25 13:53:18 +00:00
* @see wc_default_product_tabs()
*/
$tabs = apply_filters( 'woocommerce_product_tabs', array() );
2012-04-03 09:34:02 +00:00
if ( ! empty( $tabs ) ) : ?>
2013-01-03 11:40:10 +00:00
<div class="woocommerce-tabs">
2012-04-03 09:34:02 +00:00
<ul class="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" 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>
2012-04-03 09:34:02 +00:00
<?php endif; ?>