From ccf5e61a075c35d24befc175994b5cb8957ca322 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Wed, 26 Aug 2026 21:45:53 +0000
Subject: [PATCH] =Extra JVB() calls replaced, minor tweaks
---
inc/helpers/renderFields.php | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/inc/helpers/renderFields.php b/inc/helpers/renderFields.php
index 150af0e..718b66d 100644
--- a/inc/helpers/renderFields.php
+++ b/inc/helpers/renderFields.php
@@ -62,9 +62,9 @@
* @param string $type
* @return string
*/
-function jvbRenderLinks(int $ID, string $type =''):string
+function jvbRenderLinks(int $ID, string $type ='post'):string
{
- $cache = Cache::for('user_links', WEEK_IN_SECONDS)->connect('post')->connect('taxonomy')->connect('user');
+ $cache = Cache::for('user_links_'.$type, $type,WEEK_IN_SECONDS);
$cached = $cache->get($ID);
if ($cached) {
return $cached;
@@ -143,13 +143,16 @@
/**
* @param int $ID
- * @param string $type
+ * @param ?string $type
*
* @return string
*/
-function jvbRenderContactInfo(int $ID, string $type = ''):string
+function jvbRenderContactInfo(int $ID, ?string $type = null):string
{
- $cache = Cache::for('contact', WEEK_IN_SECONDS)->connect('post')->connect('taxonomy');
+ if (is_null($type)) {
+ return '';
+ }
+ $cache = Cache::for('contact_'.$type, $type,WEEK_IN_SECONDS);
$cached = $cache->get($ID);
if($cached){
@@ -376,7 +379,7 @@
return '';
}
}
- $cache = Cache::for($term->taxonomy.'_link')->connect('taxonomy');
+ $cache = Cache::for($term->taxonomy.'_link', 'term');
$key = $term->term_id;
return $cache->remember(
$key,
@@ -599,9 +602,9 @@
return '';
}
- $cache = Cache::for('locations')->connect('taxonomy');
- $key = $cache->generateKey($location);
+ $cache = Cache::for('tax_locations', 'term');
+ $cached = $cache->get($location);
$cached = false;
if ($cached) {
return $cached;
@@ -633,7 +636,7 @@
);
$cached = '<p class="find-us">'.jvbIcon('map-pin').'Find us here: '.$google.$apple.'</p>';
- $cache->set($key, $cached);
+ $cache->set($location, $cached);
return $cached;
}
--
Gitblit v1.10.0