From 0afb2c0046b55c123eafb4ab9ee77efa68d12463 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sat, 06 Jun 2026 17:15:31 +0000
Subject: [PATCH] =Starting the Favourites.js setup, converting previous Northeh stuff to new Registrar, fixing up Square.php integration to match

---
 inc/utility/Image.php |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/inc/utility/Image.php b/inc/utility/Image.php
index 6c7f41d..384a699 100644
--- a/inc/utility/Image.php
+++ b/inc/utility/Image.php
@@ -81,7 +81,7 @@
 					$postSlug = jvbNoBase($tax->taxonomy);
 				}elseif (is_post_type_archive()) {
 					$obj = get_queried_object();
-					$postSlug = jvbNoBase($obj->post_type);
+					$postSlug = jvbNoBase($obj->name);
 				}
 
 			}
@@ -185,5 +185,18 @@
 	{
 		return (new Image)->formatImage($id, $start, $replace, $addLink, $postSlug);
 	}
-
+	public static function SVG(string $slug):string
+	{
+		$cache = Cache::for('svgs');
+		if (JVB_TESTING) {
+			$cache->flush();
+		}
+		return $cache->remember(
+			$slug,
+			function() use ($slug) {
+				$filename = JVB_CHILD_DIR.'/assets/icons/'.$slug.'.svg';
+				return file_exists($filename) ? file_get_contents($filename) : '';
+			}
+		);
+	}
 }

--
Gitblit v1.10.0