| @@ -5,85 +5,79 @@ | ||
| 5 | 5 | * @package Powerkit |
| 6 | 6 | * @subpackage Templates |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -// Exit if accessed directly. | |
| 10 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 11 | - exit; | |
| 12 | -} | |
| 13 | - | |
| 14 | 9 | /** |
| 15 | 10 | * Tabs |
| 16 | 11 | */ |
| 17 | -add_action( 'init', function () { | |
| 18 | - powerkit_basic_shortcodes_register( array( | |
| 19 | - 'name' => 'tabs', | |
| 20 | - 'title' => esc_html__( 'Tabs', 'powerkit' ), | |
| 21 | - 'priority' => 40, | |
| 22 | - 'base' => 'powerkit_tabs', | |
| 23 | - 'autoregister' => true, | |
| 24 | - 'fields' => array( | |
| 25 | - array( | |
| 26 | - 'type' => 'section', | |
| 27 | - 'label' => esc_html__( 'Options', 'powerkit' ), | |
| 12 | +powerkit_basic_shortcodes_register( array( | |
| 13 | + 'name' => 'tabs', | |
| 14 | + 'title' => esc_html__( 'Tabs', 'powerkit' ), | |
| 15 | + 'priority' => 40, | |
| 16 | + 'base' => 'powerkit_tabs', | |
| 17 | + 'autoregister' => true, | |
| 18 | + 'fields' => array( | |
| 19 | + array( | |
| 20 | + 'type' => 'section', | |
| 21 | + 'label' => esc_html__( 'Options', 'powerkit' ), | |
| 22 | + ), | |
| 23 | + array( | |
| 24 | + 'type' => 'radio', | |
| 25 | + 'name' => 'type', | |
| 26 | + 'label' => esc_html__( 'Type', 'powerkit' ), | |
| 27 | + 'style' => 'horizontal', | |
| 28 | + 'default' => 'tabs', | |
| 29 | + 'options' => array( | |
| 30 | + 'tabs' => esc_html__( 'Tabs', 'powerkit' ), | |
| 31 | + 'pills' => esc_html__( 'Pills', 'powerkit' ), | |
| 28 | 32 | ), |
| 29 | - array( | |
| 30 | - 'type' => 'radio', | |
| 31 | - 'name' => 'type', | |
| 32 | - 'label' => esc_html__( 'Type', 'powerkit' ), | |
| 33 | - 'style' => 'horizontal', | |
| 34 | - 'default' => 'tabs', | |
| 35 | - 'options' => array( | |
| 36 | - 'tabs' => esc_html__( 'Tabs', 'powerkit' ), | |
| 37 | - 'pills' => esc_html__( 'Pills', 'powerkit' ), | |
| 38 | - ), | |
| 33 | + ), | |
| 34 | + array( | |
| 35 | + 'type' => 'radio', | |
| 36 | + 'name' => 'nav', | |
| 37 | + 'label' => esc_html__( 'Navigation type', 'powerkit' ), | |
| 38 | + 'style' => 'horizontal', | |
| 39 | + 'default' => 'horizontal', | |
| 40 | + 'options' => array( | |
| 41 | + 'horizontal' => esc_html__( 'Horizontal', 'powerkit' ), | |
| 42 | + 'vertical' => esc_html__( 'Vertical', 'powerkit' ), | |
| 39 | 43 | ), |
| 40 | - array( | |
| 41 | - 'type' => 'radio', | |
| 42 | - 'name' => 'nav', | |
| 43 | - 'label' => esc_html__( 'Navigation type', 'powerkit' ), | |
| 44 | - 'style' => 'horizontal', | |
| 45 | - 'default' => 'horizontal', | |
| 46 | - 'options' => array( | |
| 47 | - 'horizontal' => esc_html__( 'Horizontal', 'powerkit' ), | |
| 48 | - 'vertical' => esc_html__( 'Vertical', 'powerkit' ), | |
| 44 | + ), | |
| 45 | + array( | |
| 46 | + 'type' => 'section', | |
| 47 | + 'label' => esc_html__( 'Content', 'powerkit' ), | |
| 48 | + ), | |
| 49 | + array( | |
| 50 | + 'type' => 'repeater', | |
| 51 | + 'base' => 'powerkit_tab', | |
| 52 | + 'autoregister' => true, | |
| 53 | + 'label' => esc_html__( 'Tabs', 'powerkit' ), | |
| 54 | + 'fields' => array( | |
| 55 | + array( | |
| 56 | + 'type' => 'input', | |
| 57 | + 'name' => 'title', | |
| 58 | + 'label' => esc_html__( 'Title', 'powerkit' ), | |
| 59 | + 'default' => '', | |
| 60 | + 'attrs' => array( | |
| 61 | + 'class' => 'widefat', | |
| 62 | + ), | |
| 49 | 63 | ), |
| 50 | - ), | |
| 51 | - array( | |
| 52 | - 'type' => 'section', | |
| 53 | - 'label' => esc_html__( 'Content', 'powerkit' ), | |
| 54 | - ), | |
| 55 | - array( | |
| 56 | - 'type' => 'repeater', | |
| 57 | - 'base' => 'powerkit_tab', | |
| 58 | - 'autoregister' => true, | |
| 59 | - 'label' => esc_html__( 'Tabs', 'powerkit' ), | |
| 60 | - 'fields' => array( | |
| 61 | - array( | |
| 62 | - 'type' => 'input', | |
| 63 | - 'name' => 'title', | |
| 64 | - 'label' => esc_html__( 'Title', 'powerkit' ), | |
| 65 | - 'default' => '', | |
| 66 | - 'attrs' => array( | |
| 67 | - 'class' => 'widefat', | |
| 68 | - ), | |
| 64 | + array( | |
| 65 | + 'type' => 'content', | |
| 66 | + 'name' => 'content', | |
| 67 | + 'label' => esc_html__( 'Content', 'powerkit' ), | |
| 68 | + 'default' => '', | |
| 69 | + 'attrs' => array( | |
| 70 | + 'class' => 'widefat', | |
| 71 | + 'rows' => 6, | |
| 69 | 72 | ), |
| 70 | - array( | |
| 71 | - 'type' => 'content', | |
| 72 | - 'name' => 'content', | |
| 73 | - 'label' => esc_html__( 'Content', 'powerkit' ), | |
| 74 | - 'default' => '', | |
| 75 | - 'attrs' => array( | |
| 76 | - 'class' => 'widefat', | |
| 77 | - 'rows' => 6, | |
| 78 | - ), | |
| 79 | - ), | |
| 80 | 73 | ), |
| 81 | 74 | ), |
| 82 | 75 | ), |
| 83 | - ) ); | |
| 84 | -}); | |
| 76 | + ), | |
| 77 | +) ); | |
| 85 | 78 | |
| 79 | + | |
| 86 | 80 | /** |
| 87 | 81 | * Tabs Wrap Shortcode |
| 88 | 82 | * |
| 89 | 83 | * @param array $output Shortcode HTML. |
| @@ -111,9 +105,9 @@ | ||
| 111 | 105 | '<li class="pk-nav-item"><a class="pk-nav-link%s pk-font-heading" data-toggle="%s" href="#%s">%s</a></li>', |
| 112 | 106 | ( 1 === $num ) ? ' pk-active' : '', |
| 113 | 107 | $data_toggle, |
| 114 | 108 | $content_id, |
| 115 | - wp_kses( $tab['title'], 'post' ) | |
| 109 | + $tab['title'] | |
| 116 | 110 | ); |
| 117 | 111 | |
| 118 | 112 | $pane_items .= sprintf( |
| 119 | 113 | '<div id="%s" class="pk-tab-pane pk-fade%s" role="tabpanel">%s</div>', |
| @@ -118,9 +112,9 @@ | ||
| 118 | 112 | $pane_items .= sprintf( |
| 119 | 113 | '<div id="%s" class="pk-tab-pane pk-fade%s" role="tabpanel">%s</div>', |
| 120 | 114 | $content_id, |
| 121 | 115 | ( 1 === $num ) ? ' pk-show pk-active' : '', |
| 122 | - wp_kses( $tab['content'], 'post' ) | |
| 116 | + $tab['content'] | |
| 123 | 117 | ); |
| 124 | 118 | |
| 125 | 119 | $num++; |
| 126 | 120 | } |
| @@ -129,11 +123,11 @@ | ||
| 129 | 123 | $powerkit_basic_shortcodes_tabs = array(); |
| 130 | 124 | |
| 131 | 125 | // Tabs Output. |
| 132 | 126 | $output = ''; |
| 133 | - $output .= '<div class="pk-tabs pk-tabs-' . sanitize_html_class( $atts['nav'] ) . '">'; | |
| 127 | + $output .= '<div class="pk-tabs pk-tabs-' . $atts['nav'] . '">'; | |
| 134 | 128 | $output .= '<div class="pk-tabs-container">'; |
| 135 | - $output .= '<div class="pk-tabs-navigation"><ul class="pk-nav pk-nav-' . sanitize_html_class( $atts['type'] ) . '" role="tablist">' . $nav_items . '</ul></div>'; | |
| 129 | + $output .= '<div class="pk-tabs-navigation"><ul class="pk-nav pk-nav-' . $atts['type'] . '" role="tablist">' . $nav_items . '</ul></div>'; | |
| 136 | 130 | $output .= '<div class="pk-tabs-content"><div class="pk-tab-content">' . $pane_items . '</div></div>'; |
| 137 | 131 | $output .= '</div>'; |
| 138 | 132 | $output .= '</div>'; |
| 139 | 133 | |
| @@ -156,10 +150,10 @@ | ||
| 156 | 150 | $powerkit_basic_shortcodes_tabs = array(); |
| 157 | 151 | } |
| 158 | 152 | |
| 159 | 153 | $powerkit_basic_shortcodes_tabs[] = array( |
| 160 | - 'title' => wp_kses( $atts['title'], 'post' ), | |
| 161 | - 'content' => wp_kses( $content, 'post' ), | |
| 154 | + 'title' => $atts['title'], | |
| 155 | + 'content' => $content, | |
| 162 | 156 | ); |
| 163 | 157 | |
| 164 | 158 | return false; |
| 165 | 159 | } |