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/timeline.php | 139 +++++++++++++++++++++++++++++++++++++++-------
1 files changed, 117 insertions(+), 22 deletions(-)
diff --git a/taxonomies/timeline.php b/taxonomies/timeline.php
index 7200d14..60f9d6e 100644
--- a/taxonomies/timeline.php
+++ b/taxonomies/timeline.php
@@ -1,27 +1,122 @@
<?php
-// /taxonomies/progress.php
-function altr_timeline():array
+// /taxonomies/timeline.php
+
+use JVBase\registrar\Registrar;
+if (!defined('ABSPATH')) {
+ exit;
+}
+
+add_action('jvbDefineRegistrar', 'altr_timeline');
+add_action('jvbDefineRegistrarFields', 'altr_timeline_fields');
+add_action('plugins_loaded', 'altr_timeline',1);
+//Add fields later so we can verify taxonomies/post types exist
+add_action('plugins_loaded', 'altr_timeline_fields', 2);
+
+add_filter('altr_TimelineSchemaDefault', 'altr_timeline_schema');
+add_filter('altr_TimelineMetaDefault', 'altr_timeline_meta');
+add_filter('altr_TimelineArchiveDefault', 'altr_timeline_archive');
+
+function altr_timeline(){
+ if (!class_exists('JVBase\registrar\Registrar')) {
+ return;
+ }
+ $timeline = Registrar::forTerm('timeline', 'Timeline', 'Timelines')
+ ->setIcon('hourglass')
+ ->make([
+ 'rewrite' => [
+ 'slug' => 'before-and-after/by/timeline',
+ '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 = $timeline->getConfig('directory');
+
+}
+
+function altr_timeline_fields():void
+{
+ if (!class_exists('JVBase\registrar\Registrar')) {
+ return;
+ }
+ $timeline = Registrar::getInstance('timeline');
+
+ $fields = $timeline->fields();
+ $fields->addCommon('wiki');
+}
+
+function altr_timeline_schema():array
{
return [
- 'singular' => 'Timeline',
- 'plural' => 'Timelines',
- 'icon' => 'hourglass',
- 'show_feed' => true,
- 'show_directory' => true,
- 'rewrite' => [
- 'slug' => 'before-and-after/by/timeline',
- 'with_front' => false,
- ],
- 'for_content' => [
- 'progress',
- ],
- 'fields' => [
- 'term_name' => [
- 'label' => 'Name',
- 'type' => 'text',
- 'quickEdit' => true,
- ],
- 'common' => [ 'wiki' ]
- ]
+ 'name' => '{{name}} Between Treatments | Tattoo Removal Progress',
];
}
+
+function altr_timeline_meta():array
+{
+ return[
+ 'name' => '{{name}} Between Treatments | Tattoo Removal Progress',
+ 'description' => 'See how tattoos heal and fade with {{name}} between laser removal sessions.',
+ ];
+}
+
+function altr_timeline_archive(array $defaults):array
+{
+ return array_merge($defaults, [
+ 'name' => '{{name}} Between Treatments | Tattoo Removal Progress',
+ ]);
+}
+
+function altr_timeline_reference_schema(array $defaults):array
+{
+ return $defaults;
+}
+
+//
+//function altr_timeline():array
+//{
+// return [
+// 'singular' => 'Timeline',
+// 'plural' => 'Timelines',
+// 'icon' => 'hourglass',
+// 'show_feed' => true,
+// 'show_directory' => true,
+// 'rewrite' => [
+// 'slug' => 'before-and-after/by/timeline',
+// 'with_front' => false,
+// ],
+// 'for_content' => [
+// 'progress',
+// ],
+// 'seo' => [
+// 'meta' => [
+// 'title' => '{{term_name}} Between Treatments – Tattoo Removal Progress',
+// 'description' => 'See how tattoos heal and fade with {{term_name}} between laser removal sessions.',
+// ],
+// 'schema' => [
+// 'type' => 'CollectionPage',
+// 'name' => '{{term_name}} Between Treatments – Progress Photos',
+// ],
+// 'archive' => [
+// 'type' => 'CollectionPage',
+// 'name' => 'Tattoo Removal with {{term_name}} Between Sessions',
+// ],
+// ],
+// 'fields' => [
+// 'term_name' => [
+// 'label' => 'Name',
+// 'type' => 'text',
+// 'quickEdit' => true,
+// ],
+// 'common' => [ 'wiki' ]
+// ]
+// ];
+//}
--
Gitblit v1.10.0