diff --git a/shortcodes/event/event-listing.php b/shortcodes/event/event-listing.php index 705bb7d..8ef7983 100644 --- a/shortcodes/event/event-listing.php +++ b/shortcodes/event/event-listing.php @@ -31,11 +31,12 @@ public function shortcode_callback($atts = [], $content = NULL, $tag = '') { try { $results = \Civi\Api4\Event::get() + ->addSelect('id', 'title', 'start_date', 'end_date', 'event_tz', 'event_type_id', 'is_online_registration') ->addWhere('start_date', '>=', 'today') ->addWhere('is_public', '=', TRUE) ->addWhere('is_active', '=', TRUE) - ->setCheckPermissions(FALSE) - ->addOrderBy('start_date', 'ASC'); + ->addOrderBy('start_date', 'ASC') + ->setCheckPermissions(FALSE); if (!empty($mod_atts['days'])) { $results->addWhere('start_date', '<=', 'today + ' . $mod_atts['days'] . ' days');