Advertisement
BackuPs-nl

rt18 tabs icon with yikes tabs plugin

Aug 2nd, 2016
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.73 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Single Product tabs
  4.  *
  5.  * @author  WooThemes
  6.  * @package WooCommerce/Templates
  7.  * @version 2.4.0
  8.  */
  9.  
  10. if ( ! defined( 'ABSPATH' ) ) {
  11.     exit;
  12. }
  13.  
  14. /**
  15.  * Filter tabs and allow third parties to add their own
  16.  *
  17.  * Each tab is an array containing title, callback and priority.
  18.  * @see woocommerce_default_product_tabs()
  19.  */
  20. $tabs = apply_filters( 'woocommerce_product_tabs', array() );
  21.  
  22.  
  23. //icons that matches with callback nanems
  24.  
  25. $tab_icons =  array(
  26.         "description" => "icon-doc-alt",
  27.         "reviews" => "icon-chat-empty",
  28.         "additional_information" => "icon-info"
  29.     );
  30.  
  31. if ( ! empty( $tabs ) ) : ?>
  32. <div class="row clearfix">
  33. <div class="box one first">
  34.  
  35.     <div class="tabs_wrap tab-style-three">
  36.         <ul class="tabs clearfix">
  37.             <?php foreach ( $tabs as $key => $tab ) : ?>
  38.  
  39.                 <?php //icon class
  40.  
  41.                     if ( isset( $tab_icons[$key] ) ){
  42.                         $add_class = "with_icon";
  43.                         $icon = '<span class="'.$tab_icons[$key].'"></span>';
  44.                     }else{
  45.                         $pos = strpos($tab['title'], 'icon');
  46.                         if ($pos===false) $add_class = ""; else $add_class = "description_tab with_icon";
  47.                         $icon = '';                    
  48.                     }
  49.                 ?>
  50.  
  51.                 <li class="<?php echo $key ?>_tab <?php echo $add_class ?>">
  52.                     <a href="#tab-<?php echo $key ?>"><?php echo $icon ?><?php echo apply_filters( 'woocommerce_product_' . $key . '_tab_title', $tab['title'], $key ) ?></a>
  53.                 </li>
  54.  
  55.             <?php endforeach; ?>
  56.         </ul>
  57.  
  58.         <div class="panes">
  59.         <?php foreach ( $tabs as $key => $tab ) : ?>
  60.  
  61.             <div class="pane entry-content" id="tab-<?php echo $key ?>">
  62.                 <?php call_user_func( $tab['callback'], $key, $tab ) ?>
  63.             </div>
  64.  
  65.         <?php endforeach; ?>
  66.         </div>
  67.     </div>
  68. </div>
  69. </div>
  70. <div class="space margin-b40"></div>
  71. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement