From 8dd01194444bbb0dd23a93862a8b7fa5559e516c Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 02 Jun 2026 00:49:23 +0000
Subject: [PATCH] =finalizing schema output for timeline et all
---
content/terms.php | 245 +++++++++++++++++++++++++++++++++++++------------
1 files changed, 185 insertions(+), 60 deletions(-)
diff --git a/content/terms.php b/content/terms.php
index 7507ccf..92d6593 100644
--- a/content/terms.php
+++ b/content/terms.php
@@ -1,67 +1,192 @@
<?php
// /content/terms.php
-function altr_terms():array
+
+use JVBase\registrar\Registrar;
+if (!defined('ABSPATH')) {
+ exit;
+}
+
+
+add_action('jvbDefineRegistrar', 'altr_terms');
+add_action('jvbDefineRegistrarFields', 'altr_terms_fields');
+
+add_action('plugins_loaded', 'altr_terms',1);
+//Add fields later so we can verify taxonomies/post types exist
+add_action('plugins_loaded', 'altr_terms_fields', 2);
+
+add_filter('altr_TermsSchemaDefault', 'altr_terms_schema');
+add_filter('altr_TermsMetaDefault', 'altr_terms_meta');
+add_filter('altr_TermsArchiveDefault', 'altr_terms_archive');
+
+function altr_terms(){
+ if (!class_exists('JVBase\registrar\Registrar')) {
+ return;
+ }
+ $terms = Registrar::forPost('terms', 'Term', 'Terms')
+ ->setIcon('asterisk')
+ ->make([
+ 'rewrite' => [
+ 'slug' => 'glossary',
+ 'with_front' => false,
+ ],
+ 'taxonomies' => [
+ 'section',
+ ]
+ ])
+ ->setAll([
+ 'show_directory',
+ 'hide_single',
+ 'is_glossary',
+ ]);
+
+//$directory = $terms->getConfig('directory');
+
+}
+
+function altr_terms_fields():void
+{
+ if (!class_exists('JVBase\registrar\Registrar')) {
+ return;
+ }
+ $terms = Registrar::getInstance('terms');
+
+ $fields = $terms->fields();
+ $fields->addField('pronunciation', [
+ 'type' => 'repeater',
+ 'label' => 'Pronunciation',
+ 'fields' => [
+ 'part' => [
+ 'type' => 'text',
+ 'label' => 'Part',
+ ]
+ ]
+ ]);
+ $fields->addField('type', [
+ 'type' => 'radio',
+ 'label' => 'Type',
+ 'options' => [
+ 'adjective',
+ 'noun',
+ 'verb'
+ ]
+ ]);
+
+ $dashboard = $terms->config('dashboard');
+ $dashboard->setTitle('Glossary');
+ $dashboard->setDescription('Manage your terms');
+
+
+}
+
+function altr_terms_schema():array
{
return [
- 'singular' => 'Term',
- 'plural' => 'Terms',
- 'dash_title' => 'Glossary',
- 'dash_description' => 'Manage your terms',
- 'breadcrumb' => 'Glossary',
- 'hide_single' => true,
- 'icon' => 'asterisk',
- 'is_gallery' => true,
- 'rewrite' => [
- 'slug' => 'glossary',
- 'with_front' => false,
- ],
- 'fields' => [
- 'post_title' => [
- 'type' => 'text',
- 'label' => 'Title',
- ],
- 'post_status' => [
- 'type' => 'radio',
- 'label' => 'Status',
- 'hidden' => true,
- 'options' => [
- 'publish' => 'Show',
- 'draft' => 'Hide',
- 'trash' => 'Scrap',
- 'delete' => 'Permanently Delete'
- ]
- ],
- 'post_slug' => [
- 'type' => 'text',
- 'label' => 'Slug'
- ],
- 'post_content' => [
- 'type' => 'textarea',
- 'label' => 'Definition',
- 'quill' => true,
- ],
- 'pronunciation' => [
- 'type' => 'repeater',
- 'label' => 'Pronunciation',
- 'fields' => [
- 'part' => [
- 'type' => 'text',
- 'label' => 'Part',
- ]
- ]
- ],
- 'type' => [
- 'type' => 'radio',
- 'label' => 'Type',
- 'options' => [
- 'adjective',
- 'noun',
- 'verb'
- ]
- ]
- ],
- 'single_image' => false,
- 'upload_title' => 'Upload Before & Afters',
+ 'type' => 'JVBase\managers\SEO\render\Thing\Intangible\DefinedTerm',
+ 'name' => '{{post_title}} | What it Means',
+ 'description' => '{{post_content}}'
];
}
+function altr_terms_meta():array
+{
+ return[
+ 'name' => '{{post_title}} | What it Means',
+ ];
+}
+
+
+function altr_terms_archive(array $defaults):array
+{
+ return array_merge($defaults, [
+ 'mainEntity' => [
+ 'type' => 'JVBase\managers\SEO\render\Thing\CreativeWork\DefinedTermSet',
+ 'id' => 'glossary-of-terms',
+ 'name' => 'Glossary of Terms',
+ 'description' => 'Brief definitions of terms and how they relate with laser tattoo removal.'
+ ],
+
+ 'name' => 'Glossary of Terms',
+ 'description' => 'Brief definitions of terms and how they relate with laser tattoo removal.'
+ ]);
+}
+
+function altr_terms_reference_schema(array $defaults):array
+{
+ return $defaults;
+}
+//
+//function altr_terms():array
+//{
+// return [
+// 'singular' => 'Term',
+// 'plural' => 'Terms',
+// 'dash_title' => 'Glossary',
+// 'dash_description' => 'Manage your terms',
+// 'breadcrumb' => 'Glossary',
+// 'hide_single' => true,
+// 'icon' => 'asterisk',
+// 'is_gallery' => true,
+// 'seo' => [
+// 'schema' => [
+// 'type' => 'DefinedTerm',
+// 'name' => '{{post_title}}',
+// 'description' => '{{post_content}}'
+// ],
+// 'archive' => [
+// 'type' => 'DefinedTermSet',
+// ]
+// ],
+// 'rewrite' => [
+// 'slug' => 'glossary',
+// 'with_front' => false,
+// ],
+// 'fields' => [
+// 'post_title' => [
+// 'type' => 'text',
+// 'label' => 'Title',
+// ],
+// 'post_status' => [
+// 'type' => 'radio',
+// 'label' => 'Status',
+// 'hidden' => true,
+// 'options' => [
+// 'publish' => 'Show',
+// 'draft' => 'Hide',
+// 'trash' => 'Scrap',
+// 'delete' => 'Permanently Delete'
+// ]
+// ],
+// 'post_slug' => [
+// 'type' => 'text',
+// 'label' => 'Slug'
+// ],
+// 'post_content' => [
+// 'type' => 'textarea',
+// 'label' => 'Definition',
+// 'quill' => true,
+// ],
+// 'pronunciation' => [
+// 'type' => 'repeater',
+// 'label' => 'Pronunciation',
+// 'fields' => [
+// 'part' => [
+// 'type' => 'text',
+// 'label' => 'Part',
+// ]
+// ]
+// ],
+// 'type' => [
+// 'type' => 'radio',
+// 'label' => 'Type',
+// 'options' => [
+// 'adjective',
+// 'noun',
+// 'verb'
+// ]
+// ]
+// ],
+// 'single_image' => false,
+// 'upload_title' => 'Upload Before & Afters',
+// ];
+//}
+
--
Gitblit v1.10.0