source/php/Shortcodes/SingleEvent.php
public function singleEventAccordion()
    {
        global $post;

        if (!(isset($post->post_type) && $post->post_type === self::$postTypeSlug)) {
            return;
        }

        $id = $post->ID;
        $fields = is_array(get_field('event_shortc_fields', 'options')) ? get_field('event_shortc_fields', 'options') : array();
        $get_meta = get_post_meta($id);
        $occasions = \EventManagerIntegration\Helper\QueryEvents::getEventOccasions($id);
        $query_var_date = (!empty(get_query_var('date'))) ? get_query_var('date') : false;
        $meta = array();

        if (is_array($get_meta) && !empty($get_meta)) {
            foreach ($get_meta as $key => $value) {
                if (is_array($value) && count($value) == 1) {
                    $meta[$key] = self::unserData($value[0]);
                } else {
                    $meta[$key] = $value;
                }
            }
        }

        $i = 0;
        $ret = '<div class="accordion accordion-icon accordion-list event-info-shortcode">';

        // Information
        $event_info = $this->eventInfo($query_var_date, $occasions, $meta);
        if (in_array('information', $fields) && !empty($event_info)) {
            $i++;
            $ret .= '<section class="accordion-section">';
            $ret .= '<input type="radio" name="active-section" id="accordion-section-' . $i . '">';
            $ret .= '<label class="accordion-toggle" for="accordion-section-' . $i . '">';
            $ret .= '<h3>' . __('Information', 'event-integration') . '</h3>';
            $ret .= '</label>';
            $ret .= '<div class="accordion-content">';
            $ret .= $event_info;
            $ret .= '</div>';
            $ret .= '</section>';
        }

        // Location
        if (in_array('location', $fields) && !empty($meta['location'])) {
            $i++;
            $ret .= '<section class="accordion-section">';
            $ret .= '<input type="radio" name="active-section" id="accordion-section-' . $i . '">';
            $ret .= '<label class="accordion-toggle" for="accordion-section-' . $i . '">';
            $ret .= '<h3>' . __('Location', 'event-integration') . '</h3>';
            $ret .= '</label>';
            $ret .= '<div class="accordion-content">';
            $ret .= $this->eventLocation($meta, $fields);
            $ret .= '</div>';
            $ret .= '</section>';
        }

        // Booking information
        $booking_info = $this->eventBooking($meta);
        if (in_array('booking', $fields) && strpos($booking_info, '<li>')) {
            $i++;
            $ret .= '<section class="accordion-section">';
            $ret .= '<input type="radio" name="active-section" id="accordion-section-' . $i . '">';
            $ret .= '<label class="accordion-toggle" for="accordion-section-' . $i . '">';
            $ret .= '<h3>' . __('Booking and tickets', 'event-integration') . '</h3>';
            $ret .= '</label>';
            $ret .= '<div class="accordion-content">';
            $ret .= $booking_info;
            $ret .= '</div>';
            $ret .= '</section>';
        }

        // Contact
        $contact_info = $this->eventContact($meta);
        if (in_array('contact', $fields) && !empty($contact_info)) {
            $i++;
            $ret .= '<section class="accordion-section">';
            $ret .= '<input type="radio" name="active-section" id="accordion-section-' . $i . '">';
            $ret .= '<label class="accordion-toggle" for="accordion-section-' . $i . '">';
            $ret .= '<h3>' . __('Contact', 'event-integration') . '</h3>';
            $ret .= '</label>';
            $ret .= '<div class="accordion-content">';
            $ret .= '<ul>' . $contact_info . '</ul>';
            $ret .= '</div>';
            $ret .= '</section>';
        }

        // Organizers
        if (!empty($meta['organizers']) && in_array('organizers', $fields)) {
            $i++;
            $ret .= '<section class="accordion-section">';
            $ret .= '<input type="radio" name="active-section" id="accordion-section-' . $i . '">';
            $ret .= '<label class="accordion-toggle" for="accordion-section-' . $i . '">';
            $ret .= '<h3>' . __('Organizer', 'event-integration') . '</h3>';
            $ret .= '</label>';
            $ret .= '<div class="accordion-content">';
            $ret .= $this->eventOrganizer($meta, $fields);
            $ret .= '</div>';
            $ret .= '</section>';
        }

        // Occasions
        if (in_array('occasion', $fields)) {
            $i++;
            $ret .= '<section class="accordion-section">';
            $ret .= '<input type="radio" name="active-section" id="accordion-section-' . $i . '">';
            $ret .= '<label class="accordion-toggle" for="accordion-section-' . $i . '">';
            $ret .= '<h3>' . __('Occasions', 'event-integration') . '</h3>';
            $ret .= '</label>';
            $ret .= '<div class="accordion-content">';
            $ret .= $this->eventOccasions($occasions);
            $ret .= '</div>';
            $ret .= '</section>';
        }

        // Check if any links exist in array
        $link_keys = array('facebook', 'twitter', 'instagram', 'google_music', 'spotify', 'soundcloud', 'deezer', 'youtube', 'vimeo');
        $links_exist = (count(array_intersect_key(array_flip($link_keys), $meta)) > 0) ? true : false;

        // Social media and streaming links
        if ($links_exist && in_array('links', $fields)) {
            $i++;
            $ret .= '<section class="accordion-section">';
            $ret .= '<input type="radio" name="active-section" id="accordion-section-' . $i . '">';
            $ret .= '<label class="accordion-toggle" for="accordion-section-' . $i . '">';
            $ret .= '<h3>' . __('Links', 'event-integration') . '</h3>';
            $ret .= '</label>';
            $ret .= '<div class="accordion-content">';
            $ret .= $this->eventLinks($meta);
            $ret .= '</div>';
            $ret .= '</section>';
        }

        $ret .= '</div>'; // End accordion

        return $ret;
    }
public function singleEventAccordion()
    {
        global $post;

        if (!(isset($post->post_type) && $post->post_type === self::$postTypeSlug)) {
            return;
        }

        $id = $post->ID;
        $fields = is_array(get_field('event_shortc_fields', 'options')) ? get_field('event_shortc_fields', 'options') : array();
        $get_meta = get_post_meta($id);
        $occasions = \EventManagerIntegration\Helper\QueryEvents::getEventOccasions($id);
        $query_var_date = (!empty(get_query_var('date'))) ? get_query_var('date') : false;
        $meta = array();

        if (is_array($get_meta) && !empty($get_meta)) {
            foreach ($get_meta as $key => $value) {
                if (is_array($value) && count($value) == 1) {
                    $meta[$key] = self::unserData($value[0]);
                } else {
                    $meta[$key] = $value;
                }
            }
        }

        $i = 0;
        $ret = '<div class="accordion accordion-icon accordion-list event-info-shortcode">';

        // Information
        $event_info = $this->eventInfo($query_var_date, $occasions, $meta);
        if (in_array('information', $fields) && !empty($event_info)) {
            $i++;
            $ret .= '<section class="accordion-section">';
            $ret .= '<input type="radio" name="active-section" id="accordion-section-' . $i . '">';
            $ret .= '<label class="accordion-toggle" for="accordion-section-' . $i . '">';
            $ret .= '<h3>' . __('Information', 'event-integration') . '</h3>';
            $ret .= '</label>';
            $ret .= '<div class="accordion-content">';
            $ret .= $event_info;
            $ret .= '</div>';
            $ret .= '</section>';
        }

        // Location
        if (in_array('location', $fields) && !empty($meta['location'])) {
            $i++;
            $ret .= '<section class="accordion-section">';
            $ret .= '<input type="radio" name="active-section" id="accordion-section-' . $i . '">';
            $ret .= '<label class="accordion-toggle" for="accordion-section-' . $i . '">';
            $ret .= '<h3>' . __('Location', 'event-integration') . '</h3>';
            $ret .= '</label>';
            $ret .= '<div class="accordion-content">';
            $ret .= $this->eventLocation($meta, $fields);
            $ret .= '</div>';
            $ret .= '</section>';
        }

        // Booking information
        $booking_info = $this->eventBooking($meta);
        if (in_array('booking', $fields) && strpos($booking_info, '<li>')) {
            $i++;
            $ret .= '<section class="accordion-section">';
            $ret .= '<input type="radio" name="active-section" id="accordion-section-' . $i . '">';
            $ret .= '<label class="accordion-toggle" for="accordion-section-' . $i . '">';
            $ret .= '<h3>' . __('Booking and tickets', 'event-integration') . '</h3>';
            $ret .= '</label>';
            $ret .= '<div class="accordion-content">';
            $ret .= $booking_info;
            $ret .= '</div>';
            $ret .= '</section>';
        }

        // Contact
        $contact_info = $this->eventContact($meta);
        if (in_array('contact', $fields) && !empty($contact_info)) {
            $i++;
            $ret .= '<section class="accordion-section">';
            $ret .= '<input type="radio" name="active-section" id="accordion-section-' . $i . '">';
            $ret .= '<label class="accordion-toggle" for="accordion-section-' . $i . '">';
            $ret .= '<h3>' . __('Contact', 'event-integration') . '</h3>';
            $ret .= '</label>';
            $ret .= '<div class="accordion-content">';
            $ret .= '<ul>' . $contact_info . '</ul>';
            $ret .= '</div>';
            $ret .= '</section>';
        }

        // Organizers
        if (!empty($meta['organizers']) && in_array('organizers', $fields)) {
            $i++;
            $ret .= '<section class="accordion-section">';
            $ret .= '<input type="radio" name="active-section" id="accordion-section-' . $i . '">';
            $ret .= '<label class="accordion-toggle" for="accordion-section-' . $i . '">';
            $ret .= '<h3>' . __('Organizer', 'event-integration') . '</h3>';
            $ret .= '</label>';
            $ret .= '<div class="accordion-content">';
            $ret .= $this->eventOrganizer($meta, $fields);
            $ret .= '</div>';
            $ret .= '</section>';
        }

        // Occasions
        if (in_array('occasion', $fields)) {
            $i++;
            $ret .= '<section class="accordion-section">';
            $ret .= '<input type="radio" name="active-section" id="accordion-section-' . $i . '">';
            $ret .= '<label class="accordion-toggle" for="accordion-section-' . $i . '">';
            $ret .= '<h3>' . __('Occasions', 'event-integration') . '</h3>';
            $ret .= '</label>';
            $ret .= '<div class="accordion-content">';
            $ret .= $this->eventOccasions($occasions);
            $ret .= '</div>';
            $ret .= '</section>';
        }

        // Check if any links exist in array
        $link_keys = array('facebook', 'twitter', 'instagram', 'google_music', 'spotify', 'soundcloud', 'deezer', 'youtube', 'vimeo');
        $links_exist = (count(array_intersect_key(array_flip($link_keys), $meta)) > 0) ? true : false;

        // Social media and streaming links
        if ($links_exist && in_array('links', $fields)) {
            $i++;
            $ret .= '<section class="accordion-section">';
            $ret .= '<input type="radio" name="active-section" id="accordion-section-' . $i . '">';
            $ret .= '<label class="accordion-toggle" for="accordion-section-' . $i . '">';
            $ret .= '<h3>' . __('Links', 'event-integration') . '</h3>';
            $ret .= '</label>';
            $ret .= '<div class="accordion-content">';
            $ret .= $this->eventLinks($meta);
            $ret .= '</div>';
            $ret .= '</section>';
        }

        $ret .= '</div>'; // End accordion

        return $ret;
    }
Shortcode to display complete event information
@return string