HEX
Server: Apache
System: Linux p3plzcpnl489499.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: dwauav0tm6jp (6177017)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //proc/thread-self/cwd/wp-content/themes/theme1429/includes/theme_shortcodes/tabs.php
<?php
/**
 * Tabs
 *
 */

function tabs_shortcode($atts, $content = null) {

    $output = '<div class="tabs">';
    $output .= '<div class="tab-menu">';
    $output .= '<ul>';

    //Build tab menu
    $numTabs = count($atts);

    for($i = 1; $i <= $numTabs; $i++){
        $output .= '<li><a href="#tab'.$i.'">'.$atts['tab'.$i].'</a></li>';
    }

    $output .= '</ul>';
    $output .= '<div class="clear"></div>';
    $output .= '</div><!-- .tab-menu (end) -->';
    $output .= '<div class="tab-wrapper">';

    //Build content of tabs
    $tabContent = do_shortcode($content);
    $find = array();
    $replace = array();
    foreach($atts as $key => $value){
        $find[] = '['.$key.']';
        $find[] = '[/'.$key.']';
        $replace[] = '<div id="'.$key.'" class="tab">';
        $replace[] = '</div><!-- .tab (end) -->';
    }

    $tabContent = str_replace($find, $replace, $tabContent);

    $output .= $tabContent;

    $output .= '</div><!-- .tab-wrapper (end) -->';
    $output .= '</div><!-- .tabs (end) -->';

    return $output;

}

add_shortcode('tabs', 'tabs_shortcode');
?>