events = $events; $this->orders = $orders; $this->register_shortcodes(); } private function register_shortcodes() { add_shortcode('tt-event', array($this, 'event_widget_shortcode')); add_shortcode('tt-events', array($this, 'event_listing_shortcode')); add_shortcode('tt-single-event', array($this, 'single_event_shortcode')); } /** * Event widget shortcode (original, enhanced) */ public function event_widget_shortcode($atts) { $atts = shortcode_atts( array( 'url' => '', 'minimal' => 'false', 'bg_fill' => 'true', 'show_logo' => 'true', 'inherit_ref_from_url_param' => '', 'ref' => 'website_widget', ), $atts, 'tt-event' ); if (empty($atts['url'])) { return '
'; } $url = esc_url($atts['url'], array('http', 'https')); if (empty($url)) { return ''; } $minimal = $this->sanitize_boolean($atts['minimal']); $bg_fill = $this->sanitize_boolean($atts['bg_fill']); $show_logo = $this->sanitize_boolean($atts['show_logo']); $inherit_ref = sanitize_text_field($atts['inherit_ref_from_url_param']); $ref = sanitize_text_field($atts['ref']); static $widget_count = 0; $widget_count++; $widget_id = 'tt-widget-' . $widget_count; ob_start(); ?> 10, 'layout' => 'grid', 'columns' => 3, 'show_past' => 'false', 'show_image' => 'true', ), $atts, 'tt-events' ); $limit = absint($atts['limit']); $layout = sanitize_key($atts['layout']); $columns = absint($atts['columns']); $show_past = $this->sanitize_boolean($atts['show_past']); $show_image = $this->sanitize_boolean($atts['show_image']); $events = $show_past ? $this->events->get_past_events($limit) : $this->events->get_upcoming_events($limit); if (is_wp_error($events)) { return '