From 772462eeca3002a1d52508aeba485aab2b4742ad Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 03 Mar 2026 19:06:19 +0000
Subject: [PATCH] =MAJOR OVERHAUL. Likely should have made a new branch ages ago. Key changes: Registrar.php is the base for custom post types, taxonomies, and user roles. Replaces JVB_CONTENT, JVB_TAXONOMY, and JVB_USER constants, eliminates most of Features.php (except for JVB_SITE, JVB_MEMBERSHIP), and has built in sanitizing and validation via sub-classes. Also started a major overhaul of the Schema output. Created a shit ton of property traits and classes to help sanitize and ensure proper data for different schema types. Still a bunch to do, but better to be starting committing changes here on this other branch.
---
inc/managers/SEO/SchemaBuilder.php | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/inc/managers/SEO/SchemaBuilder.php b/inc/managers/SEO/SchemaBuilder.php
index 9ed0174..d4a2ee6 100644
--- a/inc/managers/SEO/SchemaBuilder.php
+++ b/inc/managers/SEO/SchemaBuilder.php
@@ -1,6 +1,8 @@
<?php
namespace JVBase\managers\SEO;
+use JVBase\registrar\Registrar;
+
if (!defined('ABSPATH')) {
exit;
}
@@ -243,9 +245,11 @@
{
$options = ['' => '-- Select Post Type --'];
- if (defined('JVB_CONTENT')) {
- foreach (JVB_CONTENT as $key => $config) {
- $options[jvbCheckBase($key)] = $config['plural'] ?? $config['singular'] ?? ucwords($key);
+ $content = Registrar::getRegistered('post');
+ if (!empty($content)){
+ foreach ($content as $c) {
+ $registrar = Registrar::getInstance($c);
+ $options[jvbCheckBase($c)] = $registrar->getPlural();
}
}
@@ -259,9 +263,12 @@
{
$options = ['' => '-- Select Taxonomy --'];
- if (defined('JVB_TAXONOMY')) {
- foreach (JVB_TAXONOMY as $key => $config) {
- $options[jvbCheckBase($key)] = $config['plural'] ?? $config['singular'] ?? ucwords($key);
+
+ $tax = Registrar::getRegistered('term');
+ if (!empty($tax)){
+ foreach ($tax as $c) {
+ $registrar = Registrar::getInstance($c);
+ $options[jvbCheckBase($c)] = $registrar->getPlural();
}
}
--
Gitblit v1.10.0