Arashtad.com Version: 1.1 Author: Amin Shahrokhi Author URI: http://shahrokhi.me License: GPL2 License URI: https://www.gnu.org/licenses/gpl-2.0.html Copyright: (c) 2011 - 2016 Arashtad Ltd. All Rights Reserved. Arashtad Tabs is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or any later version. Arashtad Tabs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Arashtad Tabs. If not, see https://www.gnu.org/licenses/gpl-2.0.html. */ // Restricting direct access defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); // Creating the widget class wpitab_widget extends WP_Widget { function __construct() { parent::__construct( // Base ID of your widget 'wpitab_widget', // Widget name will appear in UI __('Arashtad Tabs', 'wpitab_widget_domain'), // Widget description array( 'description' => __( 'Responsive tabs widget for WordPress, created by Arashtad Ltd. See Arashtad.vom for more details and professional products and services.', 'wpitab_widget_domain' ), ) ); } // Creating widget front-end // This is where the action happens public function widget( $args, $instance ) { //$widget_id = $widget_class[ count($widget_class) - 1]; $widget_id = $args['widget_id']; $widget_exploded = explode('-', $widget_id); $widget_id_num = array_slice($widget_exploded, -1); $widget_num = implode($widget_id_num); $title = apply_filters( 'widget_title', $instance['title'] ); $style = apply_filters( 'widget_text', $instance['style'] ); $header_text = apply_filters( 'widget_text', $instance['header_text'] ); $footer_text = apply_filters( 'widget_text', $instance['footer_text'] ); $fixed_width = apply_filters( 'widget_text', $instance['fixed_width'] ); $fixed_height = apply_filters( 'widget_text', $instance['fixed_height'] ); $margin = apply_filters( 'widget_text', $instance['margin'] ); $padding = apply_filters( 'widget_text', $instance['padding'] ); $tab_1 = apply_filters( 'widget_text', $instance['tab_1'] ); $content_1 = apply_filters( 'widget_text', $instance['content_1'] ); $tab_2 = apply_filters( 'widget_text', $instance['tab_2'] ); $content_2 = apply_filters( 'widget_text', $instance['content_2'] ); $tab_3 = apply_filters( 'widget_text', $instance['tab_3'] ); $content_3 = apply_filters( 'widget_text', $instance['content_3'] ); $tab_4 = apply_filters( 'widget_text', $instance['tab_4'] ); $content_4 = apply_filters( 'widget_text', $instance['content_4'] ); $tab_5 = apply_filters( 'widget_text', $instance['tab_5'] ); $content_5 = apply_filters( 'widget_text', $instance['content_5'] ); $tab_6 = apply_filters( 'widget_text', $instance['tab_6'] ); $content_6 = apply_filters( 'widget_text', $instance['content_6'] ); $tab_7 = apply_filters( 'widget_text', $instance['tab_7'] ); $content_7 = apply_filters( 'widget_text', $instance['content_7'] ); $tab_8 = apply_filters( 'widget_text', $instance['tab_8'] ); $content_8 = apply_filters( 'widget_text', $instance['content_8'] ); $tab_9 = apply_filters( 'widget_text', $instance['tab_9'] ); $content_9 = apply_filters( 'widget_text', $instance['content_9'] ); $tab_10 = apply_filters( 'widget_text', $instance['tab_10'] ); $content_10 = apply_filters( 'widget_text', $instance['content_10'] ); $tab_11 = apply_filters( 'widget_text', $instance['tab_11'] ); $content_11 = apply_filters( 'widget_text', $instance['content_11'] ); $tab_12 = apply_filters( 'widget_text', $instance['tab_12'] ); $content_12 = apply_filters( 'widget_text', $instance['content_12'] ); $tab_13 = apply_filters( 'widget_text', $instance['tab_13'] ); $content_13 = apply_filters( 'widget_text', $instance['content_13'] ); $tab_14 = apply_filters( 'widget_text', $instance['tab_14'] ); $content_14 = apply_filters( 'widget_text', $instance['content_14'] ); $tab_15 = apply_filters( 'widget_text', $instance['tab_15'] ); $content_15 = apply_filters( 'widget_text', $instance['content_15'] ); $tab_16 = apply_filters( 'widget_text', $instance['tab_16'] ); $content_16 = apply_filters( 'widget_text', $instance['content_16'] ); $tab_17 = apply_filters( 'widget_text', $instance['tab_17'] ); $content_17 = apply_filters( 'widget_text', $instance['content_17'] ); $tab_18 = apply_filters( 'widget_text', $instance['tab_18'] ); $content_18 = apply_filters( 'widget_text', $instance['content_18'] ); $tab_19 = apply_filters( 'widget_text', $instance['tab_19'] ); $content_19 = apply_filters( 'widget_text', $instance['content_19'] ); $tab_20 = apply_filters( 'widget_text', $instance['tab_20'] ); $content_20 = apply_filters( 'widget_text', $instance['content_20'] ); // before and after widget arguments are defined by themes echo $args['before_widget']; if ( ! empty( $title ) ) echo $args['before_title'] . $title . $args['after_title']; // This is where you run the code and display the output echo __( '', 'wpitab_widget_domain' ); ?> '; echo ' #itab_' . $widget_num . ' {'; if($fixed_height) { echo 'height: ' . $fixed_height . '; '; } if($fixed_width) { echo 'width: ' . $fixed_width . '; '; } if($margin) { echo 'margin: ' . $margin . '; '; } if($padding) { echo 'padding: ' . $padding . '; '; } echo '}'; echo ' '; } ?>