Last active
October 8, 2015 15:58
-
-
Save j-gardner/3355302 to your computer and use it in GitHub Desktop.
tab linking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$tabid = 0; | |
do_shortcode( $content ); | |
if( is_array($GLOBALS['tabs'] ) ) { | |
foreach ($GLOBALS['tabs'] as $tab) { | |
// set up tabid based on the id defined above | |
switch( $id ) { | |
case "name": | |
$tabid = sanitize_title( $tab['title'] ); | |
break; | |
case "number": | |
$tabid += 1; | |
break; | |
default: | |
break; | |
} | |
$tabs[] = '<li><a class="" href="#tab-' . $tabid . '">' . $tab['title'] . '</a></li>'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment