예제 #1
0
 /**
  * @return self
  */
 public static function instance()
 {
     if (empty(self::$instance)) {
         self::$instance = new self();
     }
     return self::$instance;
 }
예제 #2
0
 /**
  * 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();
 }
예제 #3
0
파일: Main.php 프로젝트: TakenCdosG/chefs
 /**
  * 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();
 }