public function __construct() { $widget_ops = array('classname' => 'tribe-events-adv-list-widget', 'description' => __('A widget that displays the next upcoming x events.', 'tribe-events-calendar-pro')); $control_ops = array('id_base' => 'tribe-events-adv-list-widget'); parent::__construct('tribe-events-adv-list-widget', __('Events List', 'tribe-events-calendar-pro'), $widget_ops, $control_ops); add_filter('tribe_events_list_widget_query_args', array($this, 'taxonomy_filters')); // Do not enqueue if the widget is inactive if (is_active_widget(false, false, $this->id_base, true)) { add_action('init', array($this, 'enqueue_stylesheet'), 100); } }
/** * Allows widgets extending this one to pass through their own unique name, ID base etc. * * @param string $id_base * @param string $name * @param array $widget_options * @param array $control_options */ public function __construct($id_base = 'tg-tribe-events-list-widget', $name = 'TG: Events Slider', $widget_options = array('classname' => 'tg-tribe-events-list-widget', 'description' => 'A Slider Widget that displays events from The Event Calendar Plugin'), $control_options = array('id_base' => 'tg-tribe-events-list-widget')) { parent::__construct($id_base, $name, $widget_options, $control_options); }