$event['id'], 'title' => $event['title'], 'description' => $can_edit ? (string) $event['description'] : '', 'description_html' => (string) $event['description_rendered'], 'location_type' => $event['location_type'], 'location' => $event['location'], 'online_url' => $see_link ? $event['online_url'] : '', 'has_link' => '' !== $event['online_url'], 'going_count' => $event['going_count'], 'maybe_count' => $event['maybe_count'], 'status' => $event['status'], 'is_past' => $ended, 'starts_at' => Time::iso( $event['starts_at'] ), 'ends_at' => Time::iso( $event['ends_at'] ), 'created_at' => Time::iso( $event['created_at'] ), 'url' => Portal::link( 'events/' . $event['id'] ), 'space' => array( 'id' => $space['id'], 'title' => $space['title'], 'slug' => $space['slug'], 'privacy' => $space['privacy'], 'icon' => isset( $space['settings']['icon'] ) ? (string) $space['settings']['icon'] : '', 'color' => isset( $space['settings']['color'] ) ? (string) $space['settings']['color'] : '', ), 'organizer' => $organizer, 'viewer' => array( 'answer' => $answer, 'can_rsvp' => $viewer_id > 0 && Events::can_rsvp( $event, $space, $viewer_id ), 'can_edit' => $can_edit, 'see_link' => $see_link, ), ); /** * Filters an event as sent to the apps. SpaceBay Pro adds the place * limit ("capacity" and "spots_left"). * * @since 1.0.0 * * @param array $data Event data. * @param array $event Event row. * @param array $space Space row. * @param int $viewer_id Viewer. * @param string $answer Viewer's answer. */ return apply_filters( 'spacebay_event_data', $data, $event, $space, $viewer_id, $answer ); } }