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/registrar/config/seo/Schema.php |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/inc/registrar/config/seo/Schema.php b/inc/registrar/config/seo/Schema.php
index 15c256e..6b01794 100644
--- a/inc/registrar/config/seo/Schema.php
+++ b/inc/registrar/config/seo/Schema.php
@@ -181,8 +181,9 @@
 					$config = $this->getConfig();
 
 					$class = JVB()->schemaHelper()::classFromConfig($config, $meta);
-
 					$class->setAuthor(JVB()->seo()->getCreator(true));
+
+					$class = apply_filters('jvb_single_'.$this->slug.'_schema_output', $class, $ID);
 					return $class->outputSchema();
 				}
 			);
@@ -294,7 +295,10 @@
 					$class->setMainEntity($itemList);
 
 					$schema = $class->outputSchema();
-					error_log('Generated archive schema: '.print_r($schema, true));
+					if (JVB_TESTING) {
+//						error_log('Generated archive schema: '.print_r($schema, true));
+					}
+
 					return $schema;
 				}
 			);
@@ -399,7 +403,7 @@
 			$config['type'] = $this->defaultSchema['type'];
 			update_option(BASE.ucfirst($this->slug).'Schema', $config);
 		}
-		$class = $this->getConfig()['type'];
+		$class = $config['type'];
 		if (!class_exists($class)) {
 			error_log('[SEO]Schema::defineReference Class not found: '.$class);
 			return;
@@ -436,10 +440,10 @@
 		if (is_singular($based)){
 			$config = $this->getConfig('meta');
 			$meta = Meta::forPost(get_the_ID());
-			$title = Resolver::resolve($config['name']??$config['title'], $meta);
+			$title = Resolver::resolve($config['name']??$config['title']??'', $meta);
 		} elseif (is_post_type_archive($based) ) {
 			$config = $this->getConfig('archive');
-			$title = $config['name'];
+			$title = Resolver::resolve($config['name'], null);
 		} elseif (is_tax($based)) {
 			$config = $this->getConfig('archive');
 			$meta = Meta::forTerm(get_queried_object_id());

--
Gitblit v1.10.0