Skip to content

Commit

Permalink
WPCIVIUX-96 Select specific fields for API call in ux_event_listing s…
Browse files Browse the repository at this point in the history
…hortcode.
  • Loading branch information
agileware-justin committed May 19, 2021
1 parent 87f426b commit 9e930c0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions shortcodes/event/event-listing.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 9e930c0

Please sign in to comment.