/** * @return self */ public static function instance() { if (empty(self::$instance)) { self::$instance = new self(); } return self::$instance; }
/** * Run on applied action init */ public function init() { $this->pluginName = __('The Events Calendar', 'the-events-calendar'); $this->rewriteSlug = $this->getRewriteSlug(); $this->rewriteSlugSingular = $this->getRewriteSlugSingular(); $this->taxRewriteSlug = $this->getTaxRewriteSlug(); $this->tagRewriteSlug = $this->getTagRewriteSlug(); $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->postTypeArgs['rewrite']['slug'] = sanitize_title($this->rewriteSlugSingular); $this->postVenueTypeArgs['rewrite']['slug'] = sanitize_title($this->singular_venue_label); $this->postVenueTypeArgs['show_in_nav_menus'] = class_exists('Tribe__Events__Pro__Main') ? true : false; $this->postOrganizerTypeArgs['rewrite']['slug'] = sanitize_title($this->singular_organizer_label); $this->postOrganizerTypeArgs['show_in_nav_menus'] = class_exists('Tribe__Events__Pro__Main') ? true : false; $this->postVenueTypeArgs['public'] = class_exists('Tribe__Events__Pro__Main') ? true : false; $this->postOrganizerTypeArgs['public'] = class_exists('Tribe__Events__Pro__Main') ? true : 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__Events__Credits::init(); Tribe__Events__Timezones::init(); $this->registerPostType(); self::debug(sprintf(__('Initializing Tribe Events on %s', 'the-events-calendar'), date('M, jS \\a\\t h:m:s a'))); $this->maybeSetTECVersion(); }