From 20f6947bea715e1a2dc086915ee8ab9f158f0756 Mon Sep 17 00:00:00 2001 From: ruru4143 Date: Sun, 29 Sep 2024 13:48:32 +0200 Subject: [PATCH] duplicated code --- includes/activitypub/transformer/class-events-manager.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/includes/activitypub/transformer/class-events-manager.php b/includes/activitypub/transformer/class-events-manager.php index 7d217ee..2b7d700 100644 --- a/includes/activitypub/transformer/class-events-manager.php +++ b/includes/activitypub/transformer/class-events-manager.php @@ -75,9 +75,6 @@ final class Events_Manager extends Event_Transformer { if ( $em_location->location_state ) { $address['addressRegion'] = $em_location->location_state; } - if ( $em_location->location_postcode ) { - $address['postalCode'] = $em_location->location_postcode; - } $location->set_address( $address ); return $location; @@ -124,8 +121,8 @@ final class Events_Manager extends Event_Transformer { * @return int */ public function get_remaining_attendee_capacity() { - $em_bookings = $this->em_event->get_bookings()->get_bookings(); - $remaining_attendee_capacity = $this->em_event->event_spaces - count( $em_bookings->bookings ); + $em_bookings_count = $this->get_participant_count(); + $remaining_attendee_capacity = $this->em_event->event_spaces - $em_bookings_count; return $remaining_attendee_capacity; }