From f383c3a4325bc173b6f9676274bc19694be6f9c0 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Fri, 05 Jun 2026 16:49:44 +0000
Subject: [PATCH] =Modified the Feed Fields config in Registrar, to utilize the built in functionality there
---
taxonomies/timeline.php | 152 +++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 117 insertions(+), 35 deletions(-)
diff --git a/taxonomies/timeline.php b/taxonomies/timeline.php
index 92ef768..e14cb66 100644
--- a/taxonomies/timeline.php
+++ b/taxonomies/timeline.php
@@ -1,41 +1,123 @@
<?php
// /taxonomies/timeline.php
-function altr_timeline():array
+
+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',
+ 'prefix_post_type',
+ ]);
+
+//$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',
- ],
- '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' ]
- ]
+ '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