From ed57c386db34d8693ca75311972d0929ebe5f488 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Mon, 01 Jun 2026 22:23:19 +0000
Subject: [PATCH] =Added some more Schema classes, allowed for override of array in outputSchema for complex schema, as for timeline post types
---
inc/managers/SEO/render/Traits/ThingSchema.php | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/inc/managers/SEO/render/Traits/ThingSchema.php b/inc/managers/SEO/render/Traits/ThingSchema.php
index 43ec460..d41ad97 100644
--- a/inc/managers/SEO/render/Traits/ThingSchema.php
+++ b/inc/managers/SEO/render/Traits/ThingSchema.php
@@ -31,11 +31,12 @@
nameTrait, ownerTrait, potentialActionTrait, sameAsTrait, subjectOfTrait, urlTrait;
protected string $id;
-
+ protected bool $showID = true;
protected array $ignore = [
'mappedMethods',
'ignore',
- 'id'
+ 'id',
+ 'showID',
];
public function outputSchema():array
{
@@ -76,9 +77,10 @@
}, ARRAY_FILTER_USE_KEY)
);
- return array_merge([
+ $id = $this->showID ? ['@id' => $id] : [];
+
+ return array_merge($id, [
'@type' => $this->getTypeName(),
- '@id' => $id,
], array_filter($elements));
}
@@ -161,4 +163,9 @@
);
}
+
+ public function showID(bool $showIt = true):void
+ {
+ $this->showID = $showIt;
+ }
}
--
Gitblit v1.10.0