Skip to content

Instantly share code, notes, and snippets.

@j-gardner
Last active October 8, 2015 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j-gardner/3355302 to your computer and use it in GitHub Desktop.
Save j-gardner/3355302 to your computer and use it in GitHub Desktop.
tab linking
<?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