diff --git a/includes/activitypub/transformer/class-event.php b/includes/activitypub/transformer/class-event.php index babd4ee..ac9d7d5 100644 --- a/includes/activitypub/transformer/class-event.php +++ b/includes/activitypub/transformer/class-event.php @@ -326,4 +326,31 @@ abstract class Event extends Post { return $activitypub_object; } + + /** + * Gets the template to use to generate the content of the event. + * + * @return string The Template. + */ + protected function get_post_content_template() { + return "[ap_content]\n\n[ap_hashtags]"; + + // Decide: what kind of control does the user get? + // e.g. we could give the user way more control by only overriding (some) defaults like this: + + /** + $type = \get_option( 'activitypub_post_content_type', 'content' ); + + switch ( $type ) { + case 'content': + return "[ap_content]\n\n[ap_hashtags]"; + break; + default: + return parent::get_post_content_template(); + break; + } + **/ + + } + } diff --git a/includes/activitypub/transformer/class-gatherpress.php b/includes/activitypub/transformer/class-gatherpress.php index 39292fd..4e64072 100644 --- a/includes/activitypub/transformer/class-gatherpress.php +++ b/includes/activitypub/transformer/class-gatherpress.php @@ -129,13 +129,6 @@ final class GatherPress extends Event { return $user->get_url(); } - /** - * Get the content. - */ - public function get_content(): string { - return $this->wp_object->post_content; - } - /** * Determine whether the event is online. * diff --git a/includes/activitypub/transformer/class-the-events-calendar.php b/includes/activitypub/transformer/class-the-events-calendar.php index 0428c66..fc6c673 100644 --- a/includes/activitypub/transformer/class-the-events-calendar.php +++ b/includes/activitypub/transformer/class-the-events-calendar.php @@ -127,12 +127,16 @@ final class The_Events_Calendar extends Event { * @return string The content. */ protected function get_content() { - $content = parent::get_content(); // /BeforeFirstRelease: - // * remove link at the end of the content. - // * add organizer. - // * do add Cancelled reason in the content.s + // * [X] remove link at the end of the content. + // * [ ] add organizer. + // * [ ] do add Cancelled reason in the content. + // Add Organizer: + // $this->wp_object->post_content .= organizer_string; + // rest will be handled by parent::get_content(). + + $content = parent::get_content(); return $content; }