From 228dba06ae166f709abb955209057301da7e6c7b Mon Sep 17 00:00:00 2001 From: ruru4143 Date: Sun, 29 Sep 2024 14:04:07 +0200 Subject: [PATCH] Revert "improved readability of get_summary by using ternary operator" This reverts commit 7c9424526dfa703456ebece817a8ae80442526ff. --- includes/activitypub/transformer/class-gatherpress.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/includes/activitypub/transformer/class-gatherpress.php b/includes/activitypub/transformer/class-gatherpress.php index db994ca..e08f0b4 100644 --- a/includes/activitypub/transformer/class-gatherpress.php +++ b/includes/activitypub/transformer/class-gatherpress.php @@ -138,9 +138,13 @@ final class GatherPress extends Event { * @return string $summary The custom event summary. */ public function get_summary(): string { - $excerpt = $this->wp_object->post_excerpt - ?: get_post_meta( $this->wp_object->ID, 'event-summary', true ) - ?: $this->get_content(); + 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 );