From aa974bf5954d0cca2506003a3cd9ec4eb89ed0bc Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Mon, 11 May 2026 18:35:55 +0000
Subject: [PATCH] =Transfer to new Registrar system

---
 taxonomies/section.php |  166 ++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 126 insertions(+), 40 deletions(-)

diff --git a/taxonomies/section.php b/taxonomies/section.php
index 7135f81..e2af585 100644
--- a/taxonomies/section.php
+++ b/taxonomies/section.php
@@ -1,46 +1,132 @@
 <?php
 // /taxonomies/section.php
-function altr_section():array
+
+use JVBase\registrar\Registrar;
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+add_action('jvbDefineRegistrar', 'altr_section');
+add_action('jvbDefineRegistrarFields', 'altr_section_fields');
+
+add_action('plugins_loaded', 'altr_section',1);
+//Add fields later so we can verify taxonomies/post types exist
+add_action('plugins_loaded', 'altr_section_fields', 2);
+
+add_filter('altr_SectionSchemaDefault', 'altr_section_schema');
+add_filter('altr_SectionMetaDefault', 'altr_section_meta');
+add_filter('altr_SectionArchiveDefault', 'altr_section_archive');
+
+function altr_section(){
+    if (!class_exists('JVBase\registrar\Registrar')) {
+        return;
+    }
+    $section = Registrar::forTerm('section', 'Section', 'Sections')
+        ->setIcon('folder')
+        ->make([
+            'rewrite'   => [
+                'slug'          => 'faq',
+                'with_front'    => false,
+                'hierarchical'  => true
+            ],
+            'hierarchical' => true,
+            'for'    => [
+                'faq',
+            ],
+        ])
+        ->setAll([
+            'show_directory',
+            'show_feed',
+            'is_faq'
+        ]);
+
+//$directory = $section->getConfig('directory');
+
+}
+
+function altr_section_fields():void
+{
+    if (!class_exists('JVBase\registrar\Registrar')) {
+        return;
+    }
+    $section = Registrar::getInstance('section');
+
+    $fields = $section->fields();
+    $fields->addCommon('wiki');
+}
+
+function altr_section_schema():array
 {
     return [
-        'singular'     => 'Section',
-        'plural'       => 'Sections',
-        'icon'         => 'folder',
-        'show_feed'    => false,
-        'show_directory'=> true,
-        'rewrite'      => [
-            'slug'         => 'faq',
-            'with_front'   => false,
-            'hierarchical' => true,
-        ],
-        'hierarchical' => true,
-        'for_content'  => [
-            'faq',
-        ],
-        'seo'   => [
-            'meta'  => [
-                'title'         => '{{term_name}} | FAQ',
-                'description'   => '{{description}}'
-            ],
-            'schema' => [
-                'type'      => 'FAQPage',
-                'name'          => '{{term_name}} | FAQ',
-                'description'   => '{{term_description}}',
-            ],
-            'archive' => [
-                'type'          => 'FAQPage',
-                'name'          => '{{term_name}} - Frequently Asked Questions',
-                'description'   => '{{description}}',
-            ]
-        ],
-        'fields'       => [
-            'term_name' => [
-                'label'     => 'Name',
-                'type'      => 'text',
-                'subtype'   => 'number',
-                'quickEdit' => true,
-            ],
-            'common'    => [ 'wiki' ]
-        ]
+        'type'              => 'JVBase\managers\SEO\render\Thing\CreativeWork\WebPage\FAQPage',
+        'name'              => '{{name}} | FAQ',
+        'description'       => '{{description}}',
     ];
 }
+
+function altr_section_meta():array
+{
+    return[
+        'name'              => '{{name}} – FAQs on Tattoo Removal',
+        'description'       => '{{description}}',
+    ];
+}
+
+function altr_section_archive(array $defaults):array
+{
+    return array_merge($defaults, [
+        'type'              => 'JVBase\managers\SEO\render\Thing\CreativeWork\WebPage\FAQPage',
+        'name' => '{{name}} | FAQ',
+        'description' => '{{description}}',
+    ]);
+}
+
+function altr_section_reference_schema(array $defaults):array
+{
+    return $defaults;
+}
+//
+//function altr_section():array
+//{
+//    return [
+//        'singular'     => 'Section',
+//        'plural'       => 'Sections',
+//        'icon'         => 'folder',
+//        'show_feed'    => false,
+//        'show_directory'=> true,
+//        'rewrite'      => [
+//            'slug'         => 'faq',
+//            'with_front'   => false,
+//            'hierarchical' => true,
+//        ],
+//        'hierarchical' => true,
+//        'for_content'  => [
+//            'faq',
+//        ],
+//        'seo'   => [
+//            'meta'  => [
+//                'title'         => '{{term_name}} | FAQ',
+//                'description'   => '{{description}}'
+//            ],
+//            'schema' => [
+//                'type'      => 'FAQPage',
+//                'name'          => '{{term_name}} | FAQ',
+//                'description'   => '{{term_description}}',
+//            ],
+//            'archive' => [
+//                'type'          => 'FAQPage',
+//                'name'          => '{{term_name}} - Frequently Asked Questions',
+//                'description'   => '{{description}}',
+//            ]
+//        ],
+//        'fields'       => [
+//            'term_name' => [
+//                'label'     => 'Name',
+//                'type'      => 'text',
+//                'subtype'   => 'number',
+//                'quickEdit' => true,
+//            ],
+//            'common'    => [ 'wiki' ]
+//        ]
+//    ];
+//}

--
Gitblit v1.10.0