getShortcode(), $atts );
extract( $atts );
etheme_enqueue_style('tabs', true);
$el_class = $this->getExtraClass( $el_class );
// Extract tab titles
preg_match_all( '/et_tab([^\]]+)/i', $content, $matches, PREG_OFFSET_CAPTURE );
$tab_titles = array();
if ( isset( $matches[1] ) ) {
$tab_titles = $matches[1];
}
$tabs_nav = '';
$tabs_nav .= '
';
foreach ( $tab_titles as $tab ) // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited valid use case
{
$tab_atts = shortcode_parse_atts( $tab[0] );
if ( isset( $tab_atts['title'] ) ) {
$tab_id = ( isset( $tab_atts['tab_id'] ) ? $tab_atts['tab_id'] : sanitize_title( $tab_atts['title'] ) );
$image = '';
if( isset( $tab_atts['img'] ) ) {
$size = isset( $tab_atts['img_size'] ) ? $tab_atts['img_size'] : 'full';
$image = etheme_get_image($tab_atts['img'], $size );
}
if ( $atts['title_style'] == 'hover' ) {
$tabs_nav .= '- ' . $image . '' . $tab_atts['title'] . '
';
} else {
$tabs_nav .= '- ' . $image . '' . $tab_atts['title'] . '
';
}
$tabs_nav .= ( $atts['title_style'] == 'hover' ) ? '' : '';
}
}
$tabs_nav .= '
';
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, trim( ' ' . $el_class ), $this->settings['base'], $atts );
if ( ! empty( $css_class ) ) $css_class .= ' ';
$css_class .= 'title-' . $atts['title_style'];
printf(
'',
$css_class,
$tabs_nav,
wpb_js_remove_wpautop( $content )
);