/** * If the widget is active then enqueue our stylesheet. */ public function enqueue_stylesheet() { // Do not enqueue if the widget is inactive if (!is_active_widget(false, false, $this->id_base, true)) { return; } // Load the calendar widget CSS (the list widget inherits much of the same) TribeEventsPro_Widgets::enqueue_calendar_widget_styles(); }
/** * @todo revise so that our stylesheet is enqueued in time for the link to be included within the head element */ private function styles_and_scripts() { wp_enqueue_script('tribe-mini-calendar', TribeEventsPro::instance()->pluginUrl . 'resources/widget-calendar.js', array('jquery'), apply_filters('tribe_events_pro_js_version', TribeEventsPro::VERSION)); TribeEventsPro_Widgets::enqueue_calendar_widget_styles(); $widget_data = array("ajaxurl" => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http')); wp_localize_script('tribe-mini-calendar', 'TribeMiniCalendar', $widget_data); }