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/skin-type.php |  157 +++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 119 insertions(+), 38 deletions(-)

diff --git a/taxonomies/skin-type.php b/taxonomies/skin-type.php
index 7d09224..b1eb01e 100644
--- a/taxonomies/skin-type.php
+++ b/taxonomies/skin-type.php
@@ -1,44 +1,125 @@
 <?php
 // /taxonomies/skin-type.php
-function altr_skin_type():array
+
+use JVBase\registrar\Registrar;
+if (!defined('ABSPATH')) {
+    exit;
+}
+add_action('jvbDefineRegistrar', 'altr_skin_type');
+add_action('jvbDefineRegistrarFields', 'altr_skin_type_fields');
+
+add_action('plugins_loaded', 'altr_skin_type',1);
+//Add fields later so we can verify taxonomies/post types exist
+add_action('plugins_loaded', 'altr_skin_type_fields', 2);
+
+add_filter('altr_Skin_typeSchemaDefault', 'altr_skin_type_schema');
+add_filter('altr_Skin_typeMetaDefault', 'altr_skin_type_meta');
+add_filter('altr_Skin_typeArchiveDefault', 'altr_skin_type_archive');
+
+function altr_skin_type(){
+    if (!class_exists('JVBase\registrar\Registrar')) {
+        return;
+    }
+    $skinType = Registrar::forTerm('skin_type', 'Skin Type', 'Skin Types')
+        ->setIcon('dots-six')
+        ->make([
+            'rewrite'   => [
+                'slug'          => 'before-and-after/by/skin-type',
+                'with_front'    => false,
+            ],
+            'description'   => 'Complete tattoo removal or fading for a cover up tattoo (or unknown)',
+            'hierarchical' => false,
+            'for'    => [
+                'progress',
+            ],
+        ])
+        ->setAll([
+            'show_directory',
+            'show_feed',
+        ]);
+
+//$directory = $skinType->getConfig('directory');
+
+}
+
+function altr_skin_type_fields():void
+{
+    if (!class_exists('JVBase\registrar\Registrar')) {
+        return;
+    }
+    $skinType = Registrar::getInstance('skin_type');
+
+    $fields = $skinType->fields();
+    $fields->addCommon('wiki');
+}
+
+function altr_skin_type_schema():array
 {
     return [
-        'singular'       => 'Skin Type',
-        'plural'         => 'Skin Types',
-        'description'    => [
-            'According to the FitzPatrick Scale (1 - 6)',
-        ],
-        'icon'           => 'dots-six',
-        'show_feed'      => true,
-        'show_directory' => true,
-        'rewrite'        => [
-            'slug'         => 'before-and-after/by/skin-type',
-            'with_front'   => false,
-        ],
-        'for_content'    => [
-            'progress'
-        ],
-        'seo' => [
-            'meta' => [
-                'title' => 'Skin Type {{term_name}} Tattoo Removal – Before & After',
-                'description' => 'Laser tattoo removal results on FitzPatrick Skin Type {{term_name}}. Safe PicoWay treatment for all skin types in Edmonton.',
-            ],
-            'schema' => [
-                'type' => 'CollectionPage',
-                'name' => 'Tattoo Removal on Skin Type {{term_name}}',
-            ],
-            'archive' => [
-                'type' => 'CollectionPage',
-                'name' => 'FitzPatrick Skin Type {{term_name}} – Tattoo Removal Results',
-            ],
-        ],
-        'fields'         => [
-            'term_name' => [
-                'label'     => 'Name',
-                'type'      => 'text',
-                'quickEdit' => true,
-            ],
-            'common'    => [ 'wiki' ]
-        ]
+        'name'              => '{{name}} Laser Tattoo Removal Before & Afters',
     ];
 }
+
+function altr_skin_type_meta():array
+{
+    return[
+        'name'              => 'Tattoo Removal on Skin Type {{name}}',
+        'description'       => '{{description}}',
+    ];
+}
+
+function altr_skin_type_archive(array $defaults):array
+{
+    return array_merge($defaults, [
+        'name' => 'FitzPatrick Skin Type {{name}} – Tattoo Removal Results',
+    ]);
+}
+
+function altr_skin_type_reference_schema(array $defaults):array
+{
+    return $defaults;
+}
+
+//
+//function altr_skin_type():array
+//{
+//    return [
+//        'singular'       => 'Skin Type',
+//        'plural'         => 'Skin Types',
+//        'description'    => [
+//            'According to the FitzPatrick Scale (1 - 6)',
+//        ],
+//        'icon'           => 'dots-six',
+//        'show_feed'      => true,
+//        'show_directory' => true,
+//        'rewrite'        => [
+//            'slug'         => 'before-and-after/by/skin-type',
+//            'with_front'   => false,
+//        ],
+//        'for_content'    => [
+//            'progress'
+//        ],
+//        'seo' => [
+//            'meta' => [
+//                'title' => 'Skin Type {{term_name}} Tattoo Removal – Before & After',
+//                'description' => 'Laser tattoo removal results on FitzPatrick Skin Type {{term_name}}. Safe PicoWay treatment for all skin types in Edmonton.',
+//            ],
+//            'schema' => [
+//                'type' => 'CollectionPage',
+//                'name' => 'Tattoo Removal on Skin Type {{term_name}}',
+//            ],
+//            'archive' => [
+//                'type' => 'CollectionPage',
+//                'name' => 'FitzPatrick Skin Type {{term_name}} – Tattoo Removal Results',
+//            ],
+//        ],
+//        'fields'         => [
+//            'term_name' => [
+//                'label'     => 'Name',
+//                'type'      => 'text',
+//                'quickEdit' => true,
+//            ],
+//            'common'    => [ 'wiki' ]
+//        ]
+//    ];
+//}

--
Gitblit v1.10.0