'tabs', 'title' => esc_html__( 'Tabs', 'powerkit' ), 'priority' => 40, 'base' => 'powerkit_tabs', 'autoregister' => true, 'fields' => array( array( 'type' => 'section', 'label' => esc_html__( 'Options', 'powerkit' ), ), array( 'type' => 'radio', 'name' => 'type', 'label' => esc_html__( 'Type', 'powerkit' ), 'style' => 'horizontal', 'default' => 'tabs', 'options' => array( 'tabs' => esc_html__( 'Tabs', 'powerkit' ), 'pills' => esc_html__( 'Pills', 'powerkit' ), ), ), array( 'type' => 'radio', 'name' => 'nav', 'label' => esc_html__( 'Navigation type', 'powerkit' ), 'style' => 'horizontal', 'default' => 'horizontal', 'options' => array( 'horizontal' => esc_html__( 'Horizontal', 'powerkit' ), 'vertical' => esc_html__( 'Vertical', 'powerkit' ), ), ), array( 'type' => 'section', 'label' => esc_html__( 'Content', 'powerkit' ), ), array( 'type' => 'repeater', 'base' => 'powerkit_tab', 'autoregister' => true, 'label' => esc_html__( 'Tabs', 'powerkit' ), 'fields' => array( array( 'type' => 'input', 'name' => 'title', 'label' => esc_html__( 'Title', 'powerkit' ), 'default' => '', 'attrs' => array( 'class' => 'widefat', ), ), array( 'type' => 'content', 'name' => 'content', 'label' => esc_html__( 'Content', 'powerkit' ), 'default' => '', 'attrs' => array( 'class' => 'widefat', 'rows' => 6, ), ), ), ), ), ) ); /** * Tabs Wrap Shortcode * * @param array $output Shortcode HTML. * @param array $atts User defined attributes in shortcode tag. * @param string $content Shorcode tag content. * @return string Shortcode result HTML. */ function powerkit_basic_shortcodes_tabs( $output, $atts, $content ) { global $powerkit_basic_shortcodes_tabs; if ( ! is_array( $powerkit_basic_shortcodes_tabs ) ) { $powerkit_basic_shortcodes_tabs = array(); } // Output. $nav_items = ''; $pane_items = ''; $num = 1; foreach ( $powerkit_basic_shortcodes_tabs as $tab ) { $data_toggle = ( 'tabs' === $atts['type'] ) ? 'tab' : 'pill'; $item_id = uniqid(); $content_id = $data_toggle . '-' . $item_id; $nav_items .= sprintf( '