From e15f93689bdf2e1eada1f5f900d386dd7cc6dd3f Mon Sep 17 00:00:00 2001 From: ruru4143 Date: Thu, 12 Sep 2024 16:26:18 +0200 Subject: [PATCH] tribe transformer: added properties --- .../transformer/class-the-events-calendar.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/includes/activitypub/transformer/class-the-events-calendar.php b/includes/activitypub/transformer/class-the-events-calendar.php index 1c40e95..abf5adf 100644 --- a/includes/activitypub/transformer/class-the-events-calendar.php +++ b/includes/activitypub/transformer/class-the-events-calendar.php @@ -97,16 +97,28 @@ final class The_Events_Calendar extends Event { * Check if the comments are enabled for the current event. */ public function get_comments_enabled(): bool { - return ( 'open' === $this->tribe_event->comment_status ) ? true : false; + return 'open' === $this->tribe_event->comment_status; } /** * Check if the event is an online event. */ public function get_is_online(): bool { + if ( class_exists( 'Tribe\Events\Virtual\Event_Meta' ) && + $this->tribe_event->virtual_event_type && + Tribe\Events\Virtual\Event_Meta::$value_virtual_event_type === $this->tribe_event->virtual_event_type) { + return true; + } return false; } + /** + * Returns language of the event + */ + public function get_in_language(): string { + return $this->get_locale(); + } + /** * Returns the content for the ActivityPub Item with *