From 3acb42faee66868a76e653a34ef35de13ddf734f Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Thu, 01 Jan 2026 23:00:11 +0000
Subject: [PATCH] Merge branch 'main' of https://github.com/jakevdwerf/jvb

---
 inc/rest/routes/FeedRoutes.php |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/inc/rest/routes/FeedRoutes.php b/inc/rest/routes/FeedRoutes.php
index 098441e..2d9265f 100644
--- a/inc/rest/routes/FeedRoutes.php
+++ b/inc/rest/routes/FeedRoutes.php
@@ -40,7 +40,7 @@
 		$this->cache->clear();
 		$this->checker = Checker::getInstance();
 
-		if (jvbSiteUsesUmami()) {
+		if (Features::hasIntegration('umami')) {
 			$this->tracker = JVB()->connect('umami');
 		}
 		$this->setupCacheConnections();
@@ -249,6 +249,9 @@
 			$item['taxonomies'] = array_merge($item['taxonomies'], $this->extractTaxonomies($f, $postID, jvbNoBase($post->post_type)));
 			$images[$f['post_thumbnail']] = jvbImageData((int) $f['post_thumbnail']);
 		}
+		$item['fields']['number'] = count($children);
+		$item['fields']['before'] = get_post_thumbnail_id($children[0]);
+		$item['fields']['after'] = get_post_thumbnail_id($children[array_key_last($children)]);
 
 		$item['fields']['timeline'] = $subFields;
 		$item['images'] = $item['images'] + $images;
@@ -258,7 +261,7 @@
 	protected function extractTaxonomies(array $fields, int $postID, string $content):array {
 		$taxonomies = [];
 		foreach ($fields as $key => $value) {
-			if (array_key_exists($key, JVB_TAXONOMY)) {
+			if (array_key_exists($key, JVB_TAXONOMY) && (array_key_exists('public', JVB_TAXONOMY[$key]) && JVB_TAXONOMY[$key]['public']!== false)) {
 				$terms = array_map('absint', explode(',',$value));
 				foreach($terms as $termID) {
 					$term = get_term($termID, jvbCheckBase($key));
@@ -277,14 +280,17 @@
 		return $cache->remember(
 			'feed_link_'.$term->term_id,
 			function () use ($term, $postID, $type) {
-				return [
+				$base = [
 					'ID' => $term->term_id,
 					'title' => htmlspecialchars_decode($term->name),
 					'url' => get_term_link($term->term_id, $term->taxonomy),
-					'umami_click' => $this->tracker->trackTaxonomyClick($term->term_id, $term->taxonomy, [
-						'from' => $type . '_' . $postID
-					])
 				];
+				if ($this->tracker) {
+					$base['umami_click'] =$this->tracker->trackTaxonomyClick($term->term_id, $term->taxonomy, [
+						'from' => $type . '_' . $postID
+					]);
+				}
+				return $base;
 			}
 		);
 	}

--
Gitblit v1.10.0