Skip to content

Commit

Permalink
WPCIVIUX-154 Do not output location info if there is none
Browse files Browse the repository at this point in the history
  • Loading branch information
agileware-iris committed Aug 8, 2024
1 parent 6f66eee commit 733332d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion civicrm-ux.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Plugin Name: WP CiviCRM UX
* Plugin URI: https://github.com/agileware/wp-civicrm-ux
* Description: A better user experience for integrating WordPress and CiviCRM
* Version: 1.14.1
* Version: 1.14.2
* Requires at least: 5.8
* Requires PHP: 7.4
* Requires Plugins: civicrm
Expand Down
6 changes: 4 additions & 2 deletions rest/json-all-events.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,11 @@ protected function generate_event_html($event, $upload, $colors, $image_src_fiel

$template .= '<div class="civicrm-ux-event-listing-type" style="background-color: #' . ($colors[$event['event_type_id:label']] ?? '333333') . ';">' . $event['event_type_id:label'] . '</div>
<div class="civicrm-ux-event-listing-name">' . $event['title'] . '</div>
<div class="civicrm-ux-event-listing-date"><i class="fa fa-calendar-o"></i><span class="event-time-text">' . $event_time . '</span></div>
<div class="civicrm-ux-event-listing-location"><i class="fa fa-map-marker"></i><span class="event-time-text">' . $event_location . '</span></div>';
<div class="civicrm-ux-event-listing-date"><i class="fa fa-calendar-o"></i><span class="event-time-text">' . $event_time . '</span></div>';

if ( !empty($event_location) ) {
$template .= '<div class="civicrm-ux-event-listing-location"><i class="fa fa-map-marker"></i><span class="event-time-text">' . $event_location . '</span></div>';
}


$template .= $event['is_online_registration'] ? '<div class="civicrm-ux-event-listing-register" onclick="window.location.href=\'' . $url . '\'">Click here to register</div>' : '';
Expand Down

0 comments on commit 733332d

Please sign in to comment.