From 7a9054bb3f033c98067b3196378311dae54c5fbf Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 20 Jan 2026 01:31:53 +0000
Subject: [PATCH] =OperationQueue refactor to the JVBase/managers/queue namespace

---
 inc/rest/routes/FeedRoutes.php |   31 ++++++++++++++++++++++---------
 1 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/inc/rest/routes/FeedRoutes.php b/inc/rest/routes/FeedRoutes.php
index 8ffd5f4..05a97a7 100644
--- a/inc/rest/routes/FeedRoutes.php
+++ b/inc/rest/routes/FeedRoutes.php
@@ -261,13 +261,27 @@
 	protected function extractTaxonomies(array $fields, int $postID, string $content):array {
 		$taxonomies = [];
 		foreach ($fields as $key => $value) {
-			if (array_key_exists($key, JVB_TAXONOMY)) {
-				$terms = array_map('absint', explode(',',$value));
-				foreach($terms as $termID) {
-					$term = get_term($termID, jvbCheckBase($key));
-					if ($term && !is_wp_error($term)) {
-						$taxonomies[$key][$termID] = $this->formatTaxonomy($term, $postID, $content);
-					}
+			if (empty($value)) {
+				continue;
+			}
+			if (!array_key_exists($key, JVB_TAXONOMY)) {
+				continue;
+			}
+
+			$taxConfig = JVB_TAXONOMY[$key];
+			if (isset($taxConfig['public']) && $taxConfig['public'] === false) {
+				continue;
+			}
+			$terms = array_map('absint', explode(',', $value));
+			$terms = array_filter($terms); // Remove 0 values
+
+			if (empty($terms)) {
+				continue;
+			}
+			foreach($terms as $termID) {
+				$term = get_term($termID, jvbCheckBase($key));
+				if ($term && !is_wp_error($term)) {
+					$taxonomies[$key][$termID] = $this->formatTaxonomy($term, $postID, $content);
 				}
 			}
 		}
@@ -367,8 +381,7 @@
 		$args = $this->applyOrderFilters($args, $data);
 		$args = $this->applyDateFilters($args, $data);
 
-		$args = $this->applyFavouritesFilter($args, $data);
-		return $args;
+		return $this->applyFavouritesFilter($args, $data);
 	}
 
 	protected function applyTaxonomyFilters(array $args, array $data): array

--
Gitblit v1.10.0