From 266aa37c48222993bf7bdad6834e31bd08736f5e Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sat, 23 May 2026 21:22:07 +0000
Subject: [PATCH] =Post type archive meta title fix

---
 inc/utility/Image.php |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/inc/utility/Image.php b/inc/utility/Image.php
index df5c2f3..b888008 100644
--- a/inc/utility/Image.php
+++ b/inc/utility/Image.php
@@ -21,6 +21,7 @@
 		$this->imgData = Cache::for('imageData')->connect('post');
 		if (JVB_TESTING) {
 			$this->cache->flush();
+			$this->imgData->flush();
 		}
 	}
 
@@ -72,8 +73,17 @@
 
 		if ($addLink) {
 			if (!$postSlug) {
-				global $post;
-				$postSlug = $post->post_name;
+				if (is_singular()) {
+					global $post;
+					$postSlug = $post->post_name;
+				}else if (is_tax()) {
+					$tax = get_queried_object();
+					$postSlug = jvbNoBase($tax->taxonomy);
+				}elseif (is_post_type_archive()) {
+					$obj = get_queried_object();
+					$postSlug = jvbNoBase($obj->post_type);
+				}
+
 			}
 			$full = wp_get_attachment_image_src($ID, 'full');
 
@@ -86,7 +96,7 @@
 				$postSlug,
 				$postSlug,
 				$imgSlug,
-				$full[0]
+				$full[0]??''
 			);
 
 			// Add gallery attributes to img tag
@@ -144,4 +154,10 @@
 			}
 		);
 	}
+
+	public static function getData(int $imgID):array
+	{
+		return (new Image)->getImageData($imgID);
+	}
+
 }

--
Gitblit v1.10.0