Exemple #1
0
 public function __construct($attributes)
 {
     $this->arguments = shortcode_atts($this->default_args, $attributes);
     $this->taxonomy_filters();
     Tribe__Events__Pro__Widgets::enqueue_calendar_widget_styles();
     ob_start();
     the_widget('Tribe__Events__Pro__Advanced_List_Widget', $this->arguments, $this->arguments);
     $this->output = ob_get_clean();
 }
 /**
  * @todo revise so that our stylesheet is enqueued in time for the link to be included within the head element
  */
 protected function styles_and_scripts()
 {
     wp_enqueue_script('tribe-mini-calendar', tribe_events_pro_resource_url('widget-calendar.js'), array('jquery'), apply_filters('tribe_events_pro_js_version', Tribe__Events__Pro__Main::VERSION));
     Tribe__Events__Pro__Widgets::enqueue_calendar_widget_styles();
     // Tribe Events CSS filename
     $event_file = 'widget-calendar.css';
     $stylesheet_option = tribe_get_option('stylesheetOption', 'tribe');
     // What Option was selected
     switch ($stylesheet_option) {
         case 'skeleton':
             $event_file_option = 'widget-calendar-' . $stylesheet_option . '.css';
             break;
         case 'full':
             $event_file_option = 'widget-calendar-' . $stylesheet_option . '.css';
             break;
         default:
             $event_file_option = 'widget-calendar-theme.css';
             break;
     }
     $styleUrl = tribe_events_pro_resource_url($event_file_option);
     $styleUrl = apply_filters('tribe_events_pro_widget_calendar_stylesheet_url', $styleUrl);
     $styleOverrideUrl = Tribe__Events__Templates::locate_stylesheet('tribe-events/pro/' . $event_file, $styleUrl);
     // Load up stylesheet from theme or plugin
     if ($styleUrl && $stylesheet_option == 'tribe') {
         wp_enqueue_style('widget-calendar-pro-style', tribe_events_pro_resource_url('widget-calendar-full.css'), array(), apply_filters('tribe_events_pro_css_version', Tribe__Events__Pro__Main::VERSION));
         wp_enqueue_style(Tribe__Events__Main::POSTTYPE . '-widget-calendar-pro-style', $styleUrl, array(), apply_filters('tribe_events_pro_css_version', Tribe__Events__Pro__Main::VERSION));
     } else {
         wp_enqueue_style(Tribe__Events__Main::POSTTYPE . '-widget-calendar-pro-style', $styleUrl, array(), apply_filters('tribe_events_pro_css_version', Tribe__Events__Pro__Main::VERSION));
     }
     if ($styleOverrideUrl) {
         wp_enqueue_style(Tribe__Events__Main::POSTTYPE . '--widget-calendar-pro-override-style', $styleOverrideUrl, array(), apply_filters('tribe_events_pro_css_version', Tribe__Events__Pro__Main::VERSION));
     }
     $widget_data = array('ajaxurl' => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http'));
     wp_localize_script('tribe-mini-calendar', 'TribeMiniCalendar', $widget_data);
 }
 /**
  * If the widget is active then enqueue our stylesheet.
  */
 public function enqueue_stylesheet()
 {
     // Load the calendar widget CSS (the list widget inherits much of the same)
     Tribe__Events__Pro__Widgets::enqueue_calendar_widget_styles();
 }