get_settings(); // BuddyPress' integration is disabled if(!isset($settings['bp_status']) || !$settings['bp_status']) return; // Attendees Module is disabled if(!isset($settings['bp_attendees_module']) || !$settings['bp_attendees_module']) return; // BuddyPress is not installed or activated if(!function_exists('is_plugin_active')) { include_once(ABSPATH . 'wp-admin/includes/plugin.php'); } if(!(function_exists('bp_activity_add') || is_plugin_active('buddypress/bp-loader.php'))) return; $date = $event->date; $timestamp = (isset($date['start']) and isset($date['start']['timestamp'])) ? $date['start']['timestamp'] : current_time('timestamp'); $limit = $settings['bp_attendees_module_limit'] ?? 30; $bookings = $this->get_bookings($event->data->ID, $timestamp, $limit); // Book Library $book = $this->getBook(); // Start Date belongs to future but booking module cannot show so return without any output if(!$this->can_show_booking_module($event) and $timestamp > time()) return; $attendees = []; foreach($bookings as $booking) { if(!isset($attendees[$booking->post_author])) $attendees[$booking->post_author] = []; $attendees[$booking->post_author][] = $booking->ID; } // MEC User $u = $this->getUser(); ?>