From de699440ff94e9c0d8e8b5201ee93179c085bf60 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Thu, 01 Jan 2026 20:51:26 +0000
Subject: [PATCH] =Timeline fields in feedroutes.php
---
inc/forms/TaxonomySelector.php | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/inc/forms/TaxonomySelector.php b/inc/forms/TaxonomySelector.php
index 29f7df3..ab3d7d5 100644
--- a/inc/forms/TaxonomySelector.php
+++ b/inc/forms/TaxonomySelector.php
@@ -32,6 +32,7 @@
$this->id = sanitize_key($id);
$this->taxonomy = jvbCheckBase($taxonomy);
$this->name = jvbNoBase($taxonomy);
+
$this->title = JVB_TAXONOMY[$this->name]['plural'];
$this->base = $config['base']??'';
@@ -211,6 +212,10 @@
* @return string The rendered HTML
*/
public function render(array $selected = [], string $extra = ''): string {
+
+ if (array_key_exists('output', $this->config) && $this->config['output'] === 'minimal') {
+ return $this->renderTaxonomyToggle($selected, $extra);
+ }
// Build data attributes
$dataAttrs = $this->buildDataAttributes($selected);
@@ -237,12 +242,13 @@
<?= $hasAutocomplete ?>
title="Open <?= $this->singular ?> Selector"
aria-label="Select <?= esc_attr($this->plural) ?>">
- <?= jvbIcon('plus-square', ['title' => 'Add ' . $this->title]) ?>
+ <?= jvbIcon('plus-square') ?>
</button>
- <input type="text" id="<?= $this->base ?><?= esc_attr($this->config['name']) ?>-autocomplete" autocomplete="off" data-ignore data-autocomplete>
- <ul class="autocomplete-dropdown" hidden>
-
- </ul>
+ <?php if ($hasAutocomplete !== '') { ?>
+ <input type="text" id="<?= $this->base ?><?= esc_attr($this->config['name']) ?>-autocomplete" autocomplete="off" data-ignore data-autocomplete>
+ <ul class="autocomplete-dropdown" hidden>
+ </ul>
+ <?php } ?>
</div>
<div class="selected-items row" role="region" aria-label="Selected <?= esc_attr($this->plural) ?>">
@@ -259,6 +265,11 @@
return ob_get_clean();
}
+ protected function renderTaxonomyToggle(array $selected = [], string $extra = ''): string
+ {
+ return '<button type="button" data-filter="taxonomy" data-taxonomy="'.$this->name.'" title="Filter by '.$this->singular.'">'.jvbIcon($this->config['icon']).'<span class="label">'.$this->singular.'</span></button>';
+ }
+
/**
* Build data attributes string for the toggle button
*/
--
Gitblit v1.10.0