From 86c6cd3cc099d2480932ede03c12cea01e625c94 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 26 Apr 2026 21:56:28 +0000
Subject: [PATCH] =Requiring files based on Site class settings
---
base/seo.php | 27 +++++++++++++++++++++++----
1 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/base/seo.php b/base/seo.php
index 41b285d..5e12d47 100644
--- a/base/seo.php
+++ b/base/seo.php
@@ -112,19 +112,37 @@
'type' => 'JVBase\managers\SEO\render\Thing\CreativeWork\WebSite',
'name' => get_bloginfo('name'),
'url' => get_home_url(),
- 'id' => get_home_url() . '#website',
+ 'id' => get_home_url() . '/#website',
'description' => get_bloginfo('description'),
'inLanguage' => 'en-CA'
],
default => []
},
'archive' => [
- 'type' => 'JVBase\managers\SEO\render\Thing\CreativeWork\WebPage\CollectionPage',
+ 'type' => 'JVBase\inc\managers\SEO\render\Thing\CreativeWork\WebPage\CollectionPage\CollectionPage',
'name' => '{{name}}'
],
default => [],
};
- return apply_filters(BASE.ucfirst($type).ucfirst($format).'Default', $defaults);
+
+ $result = apply_filters(BASE.ucfirst($type).ucfirst($format).'Default', $defaults);
+ if ($format === 'reference' && empty($result)) {
+ $full = self::getDefault($type, 'schema');
+ if (!empty($full)) {
+ $result = [
+ 'type' => $full['type'],
+ 'name' => $full['name'],
+ 'description'=> $full['description']
+ ];
+ $check = ['id', 'url'];
+ foreach ($check as $ch) {
+ if (array_key_exists($ch, $full)) {
+ $result[$ch] = $full[$ch];
+ }
+ }
+ }
+ }
+ return $result;
}
public static function updateHistory(string $type, string $format, array $newest):bool
@@ -257,8 +275,9 @@
unset($config['type']);
$class = new $className();
+
foreach ($config as $property => $value) {
- if (is_array($value)) {
+ if (is_array($value) && array_key_exists('type', $value)) {
$value = self::classFromConfig($value, $meta);
}
$method = 'set'.ucfirst($property);
--
Gitblit v1.10.0