diff --git a/includes/activitypub/transformer/class-event.php b/includes/activitypub/transformer/class-event.php index 893778f..03c9fd2 100644 --- a/includes/activitypub/transformer/class-event.php +++ b/includes/activitypub/transformer/class-event.php @@ -276,6 +276,16 @@ abstract class Event extends Post { return $template; } + /** By default set the timezone of the WordPress site. + * + * This is likely to be overwritten by the actual transformer. + * + * @return string The timezone string of the site. + */ + public function get_timezone(): string { + return wp_timezone_string(); + } + /** * Generic function that converts an WP-Event object to an ActivityPub-Event object. * diff --git a/includes/activitypub/transformer/class-the-events-calendar.php b/includes/activitypub/transformer/class-the-events-calendar.php index eea12ac..97a1689 100644 --- a/includes/activitypub/transformer/class-the-events-calendar.php +++ b/includes/activitypub/transformer/class-the-events-calendar.php @@ -65,7 +65,7 @@ final class The_Events_Calendar extends Event { $tags[] = $tag; } } - $tags[] = parent::get_tag(); + $tags = array_merge( $tags, parent::get_tag() ); return $tags; } @@ -94,7 +94,7 @@ final class The_Events_Calendar extends Event { * * @return string status of the event */ - public function get_tribe_status() { + public function get_status() { if ( 'canceled' === $this->tribe_event->event_status ) { return 'CANCELLED'; } @@ -193,10 +193,22 @@ final class The_Events_Calendar extends Event { } $location->set_id( $venue->permalink ); $location->set_name( $venue->post_title ); + $location->set_sensitive( null ); return $location; } + /** By default set the timezone of the WordPress site. + * + * This is likely to be overwritten by the actual transformer. + * + * @return string The timezone string of the site. + */ + public function get_timezone(): string { + return $this->tribe_event->timezone; + } + + /** * Extend the default event transformers to_object function. *