Skip to content

Commit

Permalink
add apply_filters for geolocation disabling
Browse files Browse the repository at this point in the history
  • Loading branch information
volfkarlo committed May 26, 2022
1 parent 18d1fde commit 97dc9a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Geolocation/Geolocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function setLocationCookie(): void

// Add the ability to disable geolocation from an external source (generally used for GDPR purposes).
$filterName = Filters::getGeolocationFilterName('disable');
if (\has_filter($filterName)) {
if (\has_filter($filterName) && \apply_filters($filterName, null)) {
return;
}

Expand Down Expand Up @@ -113,7 +113,7 @@ public function isUserGeolocated(string $formId, array $defaultLocations, array

// Add ability to disable geolocation from external source. (Generaly used for GDPR).
$filterName = Filters::getGeolocationFilterName('disable');
if (\has_filter($filterName)) {
if (\has_filter($filterName) && \apply_filters($filterName, null)) {
Helper::logger([
'geolocation' => 'Filter disabled active, skip geolocation.',
'formIdOriginal' => $formId,
Expand Down

0 comments on commit 97dc9a1

Please sign in to comment.