diff --git a/includes/activitypub/transformer/class-events-manager.php b/includes/activitypub/transformer/class-events-manager.php index 8fbd2f1..60f8884 100644 --- a/includes/activitypub/transformer/class-events-manager.php +++ b/includes/activitypub/transformer/class-events-manager.php @@ -150,23 +150,6 @@ final class Events_Manager extends Event_Transformer { return count( $em_bookings->bookings ); } - /** - * Hardcoded function for generating a summary. - */ - public function get_summary(): ?string { - if ( $this->em_event->post_excerpt ) { - $excerpt = $this->em_event->post_excerpt; - } else { - $excerpt = $this->get_content(); - } - $address = $this->em_event->get_location()->location_name; - $start_time = strtotime( $this->get_start_time() ); - $datetime_format = get_option( 'date_format' ) . ' ' . get_option( 'time_format' ); - $start_time_string = wp_date( $datetime_format, $start_time ); - $summary = "šŸ“ {$address}\nšŸ“… {$start_time_string}\n\n{$excerpt}"; - return $summary; - } - /** * Get the event link as an ActivityPub Link object, but as an associative array. * diff --git a/includes/activitypub/transformer/class-gatherpress.php b/includes/activitypub/transformer/class-gatherpress.php index e08f0b4..e8c24d8 100644 --- a/includes/activitypub/transformer/class-gatherpress.php +++ b/includes/activitypub/transformer/class-gatherpress.php @@ -129,31 +129,6 @@ final class GatherPress extends Event { return $user->get_url(); } - /** - * Create a custom summary. - * - * It contains also the most important meta-information. The summary is often used when the - * ActivityPub object type 'Event' is not supported, e.g. in Mastodon. - * - * @return string $summary The custom event summary. - */ - public function get_summary(): string { - if ( $this->wp_object->excerpt ) { - $excerpt = $this->wp_object->post_excerpt; - } elseif ( get_post_meta( $this->wp_object->ID, 'event-summary', true ) ) { - $excerpt = get_post_meta( $this->wp_object->ID, 'event-summary', true ); - } else { - $excerpt = $this->get_content(); - } - - $address = get_post_meta( $this->wp_object->ID, 'event-location', true ); - $start_time = get_post_meta( $this->wp_object->ID, 'event-start-date', true ); - $datetime_format = get_option( 'date_format' ) . ' ' . get_option( 'time_format' ); - $start_time_string = wp_date( $datetime_format, $start_time ); - $summary = "šŸ“ {$address}\nšŸ“… {$start_time_string}\n\n{$excerpt}"; - return $summary; - } - /** * Get the content. */