Example #1
0
 /**
  * The class singleton constructor.
  *
  * @return Tribe__Events__Integrations__Manager
  */
 public static function instance()
 {
     if (empty(self::$instance)) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Example #2
0
 /**
  * Run on applied action init
  */
 public function init()
 {
     $rewrite = Tribe__Events__Rewrite::instance();
     $venue = Tribe__Events__Venue::instance();
     $organizer = Tribe__Events__Organizer::instance();
     $this->postVenueTypeArgs = $venue->post_type_args;
     $this->postOrganizerTypeArgs = $organizer->post_type_args;
     $this->pluginName = $this->plugin_name = esc_html__('The Events Calendar', 'the-events-calendar');
     $this->rewriteSlug = $this->getRewriteSlug();
     $this->rewriteSlugSingular = $this->getRewriteSlugSingular();
     $this->category_slug = $this->get_category_slug();
     $this->tag_slug = $this->get_tag_slug();
     $this->taxRewriteSlug = $this->rewriteSlug . '/' . $this->category_slug;
     $this->tagRewriteSlug = $this->rewriteSlug . '/' . $this->tag_slug;
     $this->monthSlug = sanitize_title(__('month', 'the-events-calendar'));
     $this->listSlug = sanitize_title(__('list', 'the-events-calendar'));
     $this->upcomingSlug = sanitize_title(__('upcoming', 'the-events-calendar'));
     $this->pastSlug = sanitize_title(__('past', 'the-events-calendar'));
     $this->daySlug = sanitize_title(__('day', 'the-events-calendar'));
     $this->todaySlug = sanitize_title(__('today', 'the-events-calendar'));
     $this->singular_venue_label = $this->get_venue_label_singular();
     $this->plural_venue_label = $this->get_venue_label_plural();
     $this->singular_organizer_label = $this->get_organizer_label_singular();
     $this->plural_organizer_label = $this->get_organizer_label_plural();
     $this->singular_event_label = $this->get_event_label_singular();
     $this->plural_event_label = $this->get_event_label_plural();
     $this->singular_event_label_lowercase = tribe_get_event_label_singular_lowercase();
     $this->plural_event_label_lowercase = tribe_get_event_label_plural_lowercase();
     $this->postTypeArgs['rewrite']['slug'] = $rewrite->prepare_slug($this->rewriteSlugSingular, self::POSTTYPE, false);
     $this->currentDay = '';
     $this->errors = '';
     $this->default_values = apply_filters('tribe_events_default_value_strategy', new Tribe__Events__Default_Values());
     Tribe__Events__Query::init();
     Tribe__Events__Backcompat::init();
     Tribe__Credits::init();
     Tribe__Events__Timezones::init();
     $this->registerPostType();
     Tribe__Debug::debug(sprintf(esc_html__('Initializing Tribe Events on %s', 'the-events-calendar'), date('M, jS \\a\\t h:m:s a')));
     $this->maybeSetTECVersion();
     // Start the integrations manager
     Tribe__Events__Integrations__Manager::instance()->load_integrations();
 }