Current Path : /var/test/www/ooareogundevinitiative/wp-content/themes/pain/framework/widgets/ |
Current File : /var/test/www/ooareogundevinitiative/wp-content/themes/pain/framework/widgets/combo-widgets.php |
<?php class jwsthemes_ComboWidgets_Widget extends jwstheme_Widget { function __construct() { parent::__construct( 'jw_combowigets', // Base ID __( 'Combo Widgets', 'pain' ), // Name array( 'description' => __( 'Display a list icon: Search, Cart, ...', 'pain') ) // Args ); $this->settings = array( 'title' => array( 'type' => 'text', 'std' => __( 'Combo Widgets', 'pain' ), 'label' => __( 'Title', 'pain' ) ), 'shortcode' => array( 'type' => 'text', 'std' => __( '[jwwg_search] [jwwg_cart]', 'pain' ), 'label' => __( 'Shortcode', 'pain' ) ), 'el_class' => array( 'type' => 'text', 'std' => '', 'label' => __( 'Extra Class', 'pain' ) ) ); add_action('admin_enqueue_scripts', array($this, 'widget_scripts')); } function widget_scripts() { wp_enqueue_script('widget_scripts', URI_PATH . '/framework/widgets/widgets.js'); } function widget( $args, $instance ) { global $post; extract( $args ); $title = apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ); $el_class = sanitize_title( $instance['el_class'] ); $_title = ( $title ) ? "{$before_title} {$title} {$after_title}" : ''; $shortcode = do_shortcode( $instance['shortcode'] ); $output = " {$before_widget} {$_title} <div class='combo-widgets-shortcode-wrap'>{$shortcode}</div> {$after_widget}"; if(function_exists('output_ech')) { output_ech($output); } } } /* Class jwsthemes_ComboWidgets_Widget */ if(function_exists('insert_widgets')) { function jwstheme_combowidgets_widget() { insert_widgets('jwsthemes_ComboWidgets_Widget'); } add_action('widgets_init', 'jwstheme_combowidgets_widget'); }