From c68aefb847b09daa0697de7684d3451e2e68ce1e Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Thu, 09 Jul 2026 23:10:23 +0000
Subject: [PATCH] =Refactor of Integrations.php to be a bit more useful with a suite of methods for create, update, delete back and forths for integrations where sharing is enabled. Also considering a single instance with a connect method to connect as the site (no user) vs connecting as an individual user - rather than recreating instances for every user.
---
inc/integrations/GoogleMaps.php | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/inc/integrations/GoogleMaps.php b/inc/integrations/GoogleMaps.php
index 68d58fa..545e323 100644
--- a/inc/integrations/GoogleMaps.php
+++ b/inc/integrations/GoogleMaps.php
@@ -25,7 +25,17 @@
private const DEFAULT_ZOOM = 11; // City-wide view
private const DEFAULT_MAP_ID = '873aed4ca260b4203e45b6e3';
- public function __construct()
+ protected static self $instance;
+ public static function getInstance():self
+ {
+
+ if (!isset(self::$instance)) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ protected function __construct()
{
$this->service_name = 'maps';
$this->title = 'Google Maps';
@@ -542,7 +552,7 @@
return true;
}
- if (!empty(Registrar::getFeatured('is_content', 'term')) && get_term_meta(get_queried_object_id(), BASE . 'has_map', true) === true) {
+ if (!empty(Registrar::withFeature('is_content', 'term')) && get_term_meta(get_queried_object_id(), BASE . 'has_map', true) === true) {
return true;
}
--
Gitblit v1.10.0