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

---
 users/client.php |  113 +++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 94 insertions(+), 19 deletions(-)

diff --git a/users/client.php b/users/client.php
index f83c297..d1e5ed3 100644
--- a/users/client.php
+++ b/users/client.php
@@ -1,25 +1,100 @@
 <?php
 // /users/client.php
-function altr_user_client():array
+
+use JVBase\registrar\Registrar;
+if (!defined('ABSPATH')) {
+    exit;
+}
+
+add_action('jvbDefineRegistrar', 'altr_client');
+add_action('jvbDefineRegistrarFields', 'altr_client_fields');
+add_action('plugins_loaded', 'altr_client',1);
+//Add fields later so we can verify taxonomies/post types exist
+add_action('plugins_loaded', 'altr_client_fields', 2);
+
+add_filter('altr_ClientSchemaDefault', 'altr_client_schema');
+add_filter('altr_ClientMetaDefault', 'altr_client_meta');
+add_filter('altr_ClientArchiveDefault', 'altr_client_archive');
+
+function altr_client(){
+    if (!class_exists('JVBase\registrar\Registrar')) {
+        return;
+    }
+    $client = Registrar::forUser('client', 'Client', 'Clients')
+        ->setIcon('user')
+        ->make([
+            'can_create'    => ['support']
+        ])
+        ->setAll([
+            'has_dashboard',
+            'show_feed',
+            'can_register',
+        ]);
+
+//$directory = $client->getConfig('directory');
+
+}
+
+function altr_client_fields():void
+{
+    if (!class_exists('JVBase\registrar\Registrar')) {
+        return;
+    }
+    $client = Registrar::getInstance('client');
+
+    $fields = $client->fields();
+    $fields->addCommon('wiki');
+}
+
+function altr_client_schema():array
 {
     return [
-        'label'            => 'Client',
-        'singular'          => 'Singular',
-        'plural'            => 'Plural',
-        'has_dashboard'    => true,
-        'can_create'       => ['support'],
-        'can_register'     => true,
-        'keep_stats'       => false,
-        'icon'             => 'user',
-        'register'          => [
-            'text'      => 'Refer your friends. Get rewarded.',
-            'title'     => 'Create Your Account',
-            'description'   => [
-                'Get your unique share code',
-                'Share it with your friends',
-                'Get notified when you get your credit'
-            ],
-            'submit'    => 'Create Your Account',
-        ],
+        'name'              => '{{name}} Laser Tattoo Removal Before & Afters',
     ];
 }
+
+function altr_client_meta():array
+{
+    return[
+        'name'              => '{{name}} – Before & After Laser Tattoo Removal',
+        'description'       => 'Before and after results for clients seeking {{term_name}}. See how PicoWay laser technology delivers results in Edmonton.',
+    ];
+}
+
+function altr_client_archive(array $defaults):array
+{
+    return array_merge($defaults, [
+        'name' => '{{name}} – Laser Tattoo Removal Results',
+    ]);
+}
+
+function altr_client_reference_schema(array $defaults):array
+{
+    return $defaults;
+}
+
+
+//
+//function altr_user_client():array
+//{
+//    return [
+//        'label'            => 'Client',
+//        'singular'          => 'Singular',
+//        'plural'            => 'Plural',
+//        'has_dashboard'    => true,
+//        'can_create'       => ['support'],
+//        'can_register'     => true,
+//        'keep_stats'       => false,
+//        'icon'             => 'user',
+//        'register'          => [
+//            'text'      => 'Refer your friends. Get rewarded.',
+//            'title'     => 'Create Your Account',
+//            'description'   => [
+//                'Get your unique share code',
+//                'Share it with your friends',
+//                'Get notified when you get your credit'
+//            ],
+//            'submit'    => 'Create Your Account',
+//        ],
+//    ];
+//}

--
Gitblit v1.10.0