Try This:
function defaulttab( $atts, $content = null ) {
$GLOBALS[\'tab_count\'] = 0;
do_shortcode($content)
if( is_array( $GLOBALS[\'tabs\'] ) ){
$i = 1;
foreach( $GLOBALS[\'tabs\'] as $tab ){
$tabs[] = \'<li><a class="tab" href="#">\'.$tab[\'title\'].\'</a></li>\';
$panes[] = \'<div class="tab\'.$i.\'" class="tabcontent">\' .$tab[\'content\'].\'</div>\';
$i++;
}
$return = \'<div class="tabcontainer"><ul class="selector">\'.implode( "\\n", $tabs ).\'</ul>
<div class="clear"></div>\'.implode( "\\n", $panes ).\'</div>\';
}
return $return;
}
add_shortcode(\'tab\', \'defaulttab\');
function defaulttabs( $atts, $content = null ) {
extract( shortcode_atts( array(
\'title\' => \'\',
\'tab\' => \'1\',
), $atts ) );
$i = $GLOBALS[\'tab_count\'];
$GLOBALS[\'tabs\'][$i] = array( \'title\' => sprintf( $title, $GLOBALS[\'tab_count\'] ), \'content\' => $content );
$GLOBALS[\'tab_count\']++;
}
add_shortcode(\'tabs\', \'defaulttabs\');