/**
  * @return self
  */
 public static function instance()
 {
     if (empty(self::$instance)) {
         self::$instance = new self();
     }
     return self::$instance;
 }
 /**
  * Compile the schema.org event data into an array
  */
 protected function build_data()
 {
     global $post;
     $id = $post->ID;
     $organizer_data = parent::build_data();
     $organizer_data[$id]->{'@type'} = 'Person';
     $organizer_data[$id]->telephone = esc_js(tribe_get_event_meta($id, '_OrganizerPhone', true));
     $organizer_data[$id]->url = esc_js(tribe_get_event_meta($id, '_OrganizerWebsite', true));
     $organizer_data[$id]->email = esc_js(tribe_get_event_meta($id, '_OrganizerEmail', true));
     return $organizer_data;
 }
Пример #3
0
 /**
  * Compile the schema.org event data into an array
  */
 protected function build_data()
 {
     global $post;
     $id = $post->ID;
     $event_data = parent::build_data();
     $event_data[$id]->{'@type'} = 'Event';
     $event_data[$id]->startDate = get_gmt_from_date(tribe_get_start_date($post, true, Tribe__Events__Date_Utils::DBDATETIMEFORMAT), 'c');
     $event_data[$id]->endDate = get_gmt_from_date(tribe_get_end_date($post, true, Tribe__Events__Date_Utils::DBDATETIMEFORMAT), 'c');
     if (tribe_has_venue($id)) {
         $event_data[$id]->location = new stdClass();
         $event_data[$id]->location->{'@type'} = 'Place';
         $event_data[$id]->location->name = tribe_get_venue($post->ID);
         $event_data[$id]->location->address = strip_tags(str_replace("\n", '', tribe_get_full_address($post->ID)));
     }
     return $event_data;
 }
 /**
  * Compile the schema.org event data into an array
  */
 protected function build_data()
 {
     global $post;
     $id = $post->ID;
     $lat = tribe_get_event_meta($id, Tribe__Events__Pro__Geo_Loc::LAT);
     $lng = tribe_get_event_meta($id, Tribe__Events__Pro__Geo_Loc::LNG);
     $venue_data = parent::build_data();
     $venue_data[$id]->{'@type'} = 'Place';
     $venue_data[$id]->address = strip_tags(str_replace("\n", '', tribe_get_full_address($post->ID)));
     $venue_data[$id]->url = esc_js(tribe_get_event_meta($id, '_VenueURL', true));
     $venue_data[$id]->telephone = esc_js(tribe_get_event_meta($id, '_VenuePhone', true));
     if ($lat && $lng) {
         $venue_data[$id]->geo = new stdClass();
         $venue_data[$id]->geo->{'@type'} = 'GeoCoordinates';
         $venue_data[$id]->geo->latitude = esc_js($lat);
         $venue_data[$id]->geo->longitude = esc_js($lng);
     }
     return $venue_data;
 }
Пример #5
0
 public function google_data_markup()
 {
     $html = apply_filters('tribe_google_data_markup_json', Tribe__Events__Google_Data_Markup::instance()->script_block());
     echo $html;
 }
Пример #6
0
 public function google_data_markup()
 {
     require_once TribeEvents::instance()->pluginPath . 'lib/Google_Data_Markup.php';
     $html = apply_filters('tribe_google_data_markup_json', Tribe__Events__Google_Data_Markup::instance()->script_block());
     echo $html;
 }