' . $tab['content'] . '
';
}
$atts['mobile'] = sanitize_key( $atts['mobile'] );
$output = '' . implode( '', $tabs ) . '
' . implode( "\n", $panes ) . '
';
// Reset tabs
$shortcodes_ultimate_global_tabs = array();
$shortcodes_ultimate_global_tabs_count = 0;
su_query_asset( 'css', 'su-shortcodes' );
su_query_asset( 'js', 'jquery' );
su_query_asset( 'js', 'su-shortcodes' );
return $output;
}
function su_shortcode_tab( $atts = null, $content = null ) {
global $shortcodes_ultimate_global_tabs, $shortcodes_ultimate_global_tabs_count;
$atts = shortcode_atts(
array(
'title' => __( 'Tab title', 'shortcodes-ultimate' ),
'disabled' => 'no',
'anchor' => '',
'url' => '',
'target' => 'blank',
'class' => '',
),
$atts,
'tab'
);
$x = $shortcodes_ultimate_global_tabs_count;
$shortcodes_ultimate_global_tabs[ $x ] = array(
'title' => $atts['title'],
'content' => do_shortcode( $content ),
'disabled' => 'yes' === $atts['disabled'] ? ' su-tabs-disabled' : '',
'anchor' => $atts['anchor'] ? ' data-anchor="' . str_replace( array( ' ', '#' ), '', esc_attr( $atts['anchor'] ) ) . '"' : '',
'url' => ' data-url="' . esc_attr( esc_url( $atts['url'] ) ) . '"',
'target' => ' data-target="' . esc_attr( $atts['target'] ) . '"',
'class' => $atts['class'],
);
$shortcodes_ultimate_global_tabs_count++;
}