Skip to content

Commit 907c528

Browse files
committed
Fix filter list to only include assigned location properties
1 parent 37344e0 commit 907c528

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
- Wanneer filters op een kaart staan ingeschakeld met `enable_filter=1` maar geen van de locaties bevatten locatie eigenschappen dan werden alle bestaande eigenschappen in de filterlijst geplaatst. Het was de intentie om alleen de locatie eigenschappen die waren toegekend in deze lijst te plaatsen. Dit is nu opgelost.
2+
13
**1.10.6 (2022-07-07)**
24

35
- Repository verhuisd naar GitHub. Releases worden nu op GitHub gepubliceerd. Plugin aangepast om hier gebruik van te maken.

plugins/gh-datainmap/includes/shortcode.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,17 @@ function($a) {
115115
if(count($location_property_ids) > 0) {
116116
$location_property_ids = array_unique(array_merge(...$location_property_ids));
117117
}
118-
$location_property_terms_unfiltered = get_terms([
119-
'taxonomy' => 'gh-dim-location-properties',
120-
'term_taxonomy_id' => $location_property_ids,
121-
'hide_empty' => true,
122-
'fields' => 'all',
123-
'orderby' => 'name',
124-
'order' => 'ASC',
125-
]);
118+
$location_property_terms_unfiltered = [];
119+
if(count($location_property_ids) > 0) {
120+
$location_property_terms_unfiltered = get_terms([
121+
'taxonomy' => 'gh-dim-location-properties',
122+
'term_taxonomy_id' => $location_property_ids,
123+
'hide_empty' => true,
124+
'fields' => 'all',
125+
'orderby' => 'name',
126+
'order' => 'ASC',
127+
]);
128+
}
126129

127130
if(!empty($args['filter_properties'])) {
128131
$include_filters = array_map('trim', explode(',', $args['filter_properties']));

0 commit comments

Comments
 (0)