/**
  * Class constructor.
  */
 private function __construct()
 {
     $this->pluginDir = trailingslashit(basename(dirname(__FILE__)));
     $this->pluginPath = trailingslashit(dirname(__FILE__));
     $this->pluginUrl = WP_PLUGIN_URL . '/' . $this->pluginDir;
     $this->pluginSlug = 'events-calendar-pro';
     $this->loadTextDomain();
     $this->weekSlug = sanitize_title(__('week', 'tribe-events-calendar-pro'));
     $this->photoSlug = sanitize_title(__('photo', 'tribe-events-calendar-pro'));
     $this->daySlug = sanitize_title(__('day', 'tribe-events-calendar-pro'));
     $this->todaySlug = sanitize_title(__('today', 'tribe-events-calendar-pro'));
     require_once 'lib/tribe-pro-template-factory.class.php';
     require_once 'lib/tribe-date-series-rules.class.php';
     require_once 'lib/tribe-ecp-custom-meta.class.php';
     require_once 'lib/tribe-events-recurrence-meta.class.php';
     require_once 'lib/tribe-recurrence.class.php';
     require_once 'lib/widget-venue.class.php';
     require_once 'lib/tribe-mini-calendar.class.php';
     require_once 'lib/widget-countdown.class.php';
     require_once 'lib/widget-calendar.class.php';
     require_once 'lib/template-classes/day.php';
     require_once 'lib/template-classes/map.php';
     require_once 'lib/template-classes/photo.php';
     require_once 'lib/template-classes/single-organizer.php';
     require_once 'lib/template-classes/single-venue.php';
     require_once 'lib/template-classes/week.php';
     require_once 'public/template-tags/general.php';
     require_once 'public/template-tags/week.php';
     require_once 'public/template-tags/venue.php';
     require_once 'public/template-tags/widgets.php';
     require_once 'lib/tribe-geoloc.class.php';
     require_once 'lib/meta-pro.php';
     //iCal
     require_once 'lib/tribe-ical.class.php';
     TribeiCal::init();
     // Tribe common resources
     require_once 'vendor/tribe-common-libraries/tribe-common-libraries.class.php';
     TribeCommonLibraries::register('advanced-post-manager', '1.0.5', $this->pluginPath . 'vendor/advanced-post-manager/tribe-apm.php');
     TribeCommonLibraries::register('related-posts', '1.1', $this->pluginPath . 'vendor/tribe-related-posts/tribe-related-posts.class.php');
     //TribeCommonLibraries::register( 'tribe-support', '0.1', $this->pluginPath . 'vendor/tribe-support/tribe-support.class.php' );
     add_action('tribe_helper_activation_complete', array($this, 'helpersLoaded'));
     add_action('init', array($this, 'init'), 10);
     add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
     add_action('wp_enqueue_scripts', array($this, 'enqueue_pro_scripts'), 8);
     add_action('wp_enqueue_scripts', array($this, 'enqueue_styles'));
     add_filter('tribe_settings_do_tabs', array($this, 'add_settings_tabs'));
     add_filter('generate_rewrite_rules', array($this, 'add_routes'), 11);
     add_filter('tribe_events_buttons_the_buttons', array($this, 'add_view_buttons'));
     add_filter('tribe_events_pre_get_posts', array($this, 'pre_get_posts'));
     add_filter('tribe_enable_recurring_event_queries', '__return_true', 10, 1);
     add_filter('body_class', array($this, 'body_class'));
     add_filter('tribe_current_events_page_template', array($this, 'select_page_template'));
     add_filter('tribe_current_events_template_class', array($this, 'get_current_template_class'));
     add_filter('tribe_events_template_paths', array($this, 'template_paths'));
     add_filter('tribe_events_template_class_path', array($this, 'template_class_path'));
     add_filter('tribe_help_tab_getting_started_text', array($this, 'add_help_tab_getting_started_text'));
     add_filter('tribe_help_tab_introtext', array($this, 'add_help_tab_intro_text'));
     add_filter('tribe_help_tab_forumtext', array($this, 'add_help_tab_forumtext'));
     // add_filter( 'tribe_events_template_single-venue.php', array( $this, 'load_venue_template' ) );
     add_action('widgets_init', array($this, 'pro_widgets_init'), 100);
     add_action('wp_loaded', array($this, 'allow_cpt_search'));
     add_action('plugin_row_meta', array($this, 'addMetaLinks'), 10, 2);
     add_filter('get_delete_post_link', array($this, 'adjust_date_on_recurring_event_trash_link'), 10, 2);
     add_action('admin_footer', array($this, 'addDeleteDialogForRecurringEvents'));
     add_filter('tribe_get_events_title', array($this, 'reset_page_title'));
     add_filter('tribe_events_add_title', array($this, 'maybeAddEventTitle'), 10, 3);
     add_filter('tribe_promo_banner', array($this, 'tribePromoBannerPro'));
     add_filter('tribe_help_tab_forums_url', array($this, 'helpTabForumsLink'));
     add_action('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'addLinksToPluginActions'));
     add_filter('tribe_events_before_html', array($this, 'events_before_html'), 10);
     // add custom fields to "the_meta" on single event template
     add_filter('tribe_events_single_event_the_meta_addon', array($this, 'single_event_the_meta_addon'), 10, 2);
     add_filter('tribe_events_single_event_meta_group_template_keys', array($this, 'single_event_meta_group_template_keys'), 10);
     add_filter('tribe_events_single_event_meta_template_keys', array($this, 'single_event_meta_template_keys'), 10);
     add_filter('tribe_event_meta_venue_name', array('Tribe_Register_Meta_Pro', 'venue_name'), 10, 2);
     add_filter('tribe_event_meta_organizer_name', array('Tribe_Register_Meta_Pro', 'organizer_name'), 10, 2);
     add_filter('tribe_events_single_event_the_meta_group_venue', array($this, 'single_event_the_meta_group_venue'), 10, 2);
     // add related events to single event view
     add_action('tribe_events_single_event_after_the_meta', 'tribe_single_related_events');
     // add_action( 'tribe_events_single_event_meta_init', array( $this, 'single_event_meta_init'), 10, 4);
     // see function tribe_convert_units( $value, $unit_from, $unit_to )
     add_filter('tribe_convert_kms_to_miles_ratio', array($this, 'kms_to_miles_ratio'));
     add_filter('tribe_convert_miles_to_kms_ratio', array($this, 'miles_to_kms_ratio'));
     /* Setup Tribe Events Bar */
     add_filter('tribe-events-bar-views', array($this, 'setup_weekview_in_bar'), 10, 1);
     add_filter('tribe-events-bar-views', array($this, 'setup_dayview_in_bar'), 15, 1);
     add_filter('tribe-events-bar-views', array($this, 'setup_photoview_in_bar'), 30, 1);
     add_filter('tribe_events_ugly_link', array($this, 'ugly_link'), 10, 3);
     add_filter('tribe_events_getLink', array($this, 'get_link'), 10, 4);
     add_filter('tribe-events-bar-date-search-default-value', array($this, 'maybe_setup_date_in_bar'));
     add_filter('tribe_bar_datepicker_caption', array($this, 'setup_datepicker_label'), 10, 1);
     add_action('tribe_events_after_the_title', array($this, 'add_recurring_occurance_setting_to_list'));
     add_filter('tribe_get_day_link', array($this, 'add_empty_date_dayview_link'), 10, 2);
     /* AJAX for loading day view */
     add_action('wp_ajax_tribe_event_day', array($this, 'wp_ajax_tribe_event_day'));
     add_action('wp_ajax_nopriv_tribe_event_day', array($this, 'wp_ajax_tribe_event_day'));
     /* AJAX for loading photo view */
     add_action('wp_ajax_tribe_photo', array($this, 'wp_ajax_tribe_photo'));
     add_action('wp_ajax_nopriv_tribe_photo', array($this, 'wp_ajax_tribe_photo'));
     /* AJAX for loading week view */
     add_action('wp_ajax_tribe_week', array($this, 'wp_ajax_tribe_week'));
     add_action('wp_ajax_nopriv_tribe_week', array($this, 'wp_ajax_tribe_week'));
     add_filter('tribe_events_pre_get_posts', array($this, 'setup_hide_recurrence_in_query'));
     add_filter('wp', array($this, 'detect_recurrence_redirect'));
     add_filter('tribe_events_register_venue_type_args', array($this, 'addSupportsThumbnail'), 10, 1);
     add_filter('tribe_events_register_organizer_type_args', array($this, 'addSupportsThumbnail'), 10, 1);
     // filter the query sql to get the recurrence end date
     add_filter('tribe_events_query_posts_joins', array($this, 'posts_join'));
     add_filter('tribe_events_query_posts_fields', array($this, 'posts_fields'));
     add_filter('tribe_events_query_end_date_column', array($this, 'end_date_column'));
 }
Пример #2
0
 /**
  * iCal Link
  *
  * Returns a sitewide ical link
  *
  * @return string URL for ical dump.
  * @since 2.0
  */
 function tribe_get_ical_link()
 {
     $output = TribeiCal::get_ical_link();
     return apply_filters('tribe_get_ical_link', $output);
 }
 /**
  * Load the ical template tags
  * Loaded late due to potential upgrade conflict since moving them from pro
  * @TODO move this require to be with the rest of the template tag includes in 3.9
  */
 public function init_ical()
 {
     //iCal
     if (!class_exists('TribeiCal')) {
         require_once 'tribe-ical.class.php';
         TribeiCal::init();
         require_once $this->pluginPath . 'public/template-tags/ical.php';
     }
 }