From a8627cdb022808cbee13e410c939cc7b75996932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Wed, 2 Oct 2024 22:40:12 +0200 Subject: [PATCH] set default status in the transformer --- includes/activitypub/transformer/class-event.php | 7 +++++++ .../activitypub/transformer/class-the-events-calendar.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/activitypub/transformer/class-event.php b/includes/activitypub/transformer/class-event.php index 1730950..5fb09f4 100644 --- a/includes/activitypub/transformer/class-event.php +++ b/includes/activitypub/transformer/class-event.php @@ -168,6 +168,13 @@ abstract class Event extends Post { return null; } + /** + * Default value for the event status. + */ + protected function get_status(): ?string { + return 'CONFIRMED'; + } + /** * Compose a human readable formatted start time. */ diff --git a/includes/activitypub/transformer/class-the-events-calendar.php b/includes/activitypub/transformer/class-the-events-calendar.php index d6eb7fa..72e25c8 100644 --- a/includes/activitypub/transformer/class-the-events-calendar.php +++ b/includes/activitypub/transformer/class-the-events-calendar.php @@ -94,7 +94,7 @@ final class The_Events_Calendar extends Event { * * @return string status of the event */ - public function get_status() { + public function get_status(): ?string { if ( 'canceled' === $this->tribe_event->event_status ) { return 'CANCELLED'; }