function widget($args, $instance) { $instance = array_merge(array('no_events' => '', 'template' => ''), $instance); extract($args, EXTR_SKIP); $template = $instance['template']; $no_events = $instance['no_events']; unset($instance['template']); unset($instance['no_events']); echo $before_widget; $widget_title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base); if ($widget_title) { echo $before_title . esc_html($widget_title) . $after_title; } unset($instance['title']); eventorganiser_list_events($instance, array('type' => 'widget', 'class' => 'eo-events eo-events-widget', 'template' => $template, 'no_events' => $no_events)); echo $after_widget; }
static function handle_eventlist_shortcode($atts = array(), $content = null) { $taxs = array('category', 'tag', 'venue'); foreach ($taxs as $tax) { if (isset($atts['event_' . $tax])) { $atts['event-' . $tax] = $atts['event_' . $tax]; unset($atts['event_' . $tax]); } } if (isset($atts['venue']) && $atts['venue'] == '%this%' || isset($atts['event-venue']) && $atts['event-venue'] == '%this%') { if (eo_get_venue_slug()) { $atts['event-venue'] = eo_get_venue_slug(); } else { unset($atts['venue']); unset($atts['event-venue']); } } if (isset($atts['users_events']) && strtolower($atts['users_events']) == 'true') { $atts['bookee_id'] = get_current_user_id(); } $args = array('class' => 'eo-events eo-events-shortcode', 'template' => $content, 'no_events' => isset($atts['no_events']) ? $atts['no_events'] : '', 'type' => 'shortcode'); return eventorganiser_list_events($atts, $args, 0); }