diff --git a/includes/activitypub/transformer/class-event-post.php b/includes/activitypub/transformer/class-event-post.php new file mode 100644 index 0000000..18c0fcf --- /dev/null +++ b/includes/activitypub/transformer/class-event-post.php @@ -0,0 +1,73 @@ +ID, 'event_begin', true ) ); + } + + /** + * Get the type. + */ + protected function get_type() { + return $this->is_event_post ? 'Event' : Post::get_type(); + } + + /** + * Get the end time from the event object. + */ + protected function get_end_time(): ?string { + $end_time = get_post_meta( $this->wp_object->ID, 'event_end', true ); + return $end_time; + } + + /** + * Get the end time from the event object. + */ + protected function get_start_time(): string { + $start_time = get_post_meta( $this->wp_object->ID, 'event_begin', true ); + return $start_time; + } + + /** + * Get location from the event object. + */ + protected function get_location(): ?Place { + return null; + } +} diff --git a/includes/activitypub/transformer/class-event.php b/includes/activitypub/transformer/class-event.php index babf2b9..6f8d5a1 100644 --- a/includes/activitypub/transformer/class-event.php +++ b/includes/activitypub/transformer/class-event.php @@ -28,7 +28,6 @@ use DateTime; * [ ] do add Cancelled reason in the content. */ abstract class Event extends Post { - /** * The WordPress event taxonomy. * @@ -43,7 +42,7 @@ abstract class Event extends Post { * * @return string The Event Object-Type. */ - protected function get_type(): string { + protected function get_type() { return 'Event'; } diff --git a/includes/class-setup.php b/includes/class-setup.php index b99eda5..f140d6a 100644 --- a/includes/class-setup.php +++ b/includes/class-setup.php @@ -134,6 +134,7 @@ class Setup { '\ActivityPub_Event_Bridge\Plugins\Modern_Events_Calendar_Lite', '\ActivityPub_Event_Bridge\Plugins\EventPrime', '\ActivityPub_Event_Bridge\Plugins\Event_Organiser', + '\ActivityPub_Event_Bridge\Plugins\Event_Post', ); /** diff --git a/includes/plugins/class-event-post.php b/includes/plugins/class-event-post.php new file mode 100644 index 0000000..d4e57be --- /dev/null +++ b/includes/plugins/class-event-post.php @@ -0,0 +1,61 @@ +