From 11b5aef35ab8d0601f72cc93f6857b078967ae93 Mon Sep 17 00:00:00 2001 From: rivanuff <16398970+rivanuff@users.noreply.github.com> Date: Thu, 12 Nov 2026 10:57:20 +0100 Subject: [PATCH 1/2] chore: allow openpub taxonomy filter params --- src/Base/RestAPI/Controllers/BaseController.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Base/RestAPI/Controllers/BaseController.php b/src/Base/RestAPI/Controllers/BaseController.php index c3a7362..2a88948 100644 --- a/src/Base/RestAPI/Controllers/BaseController.php +++ b/src/Base/RestAPI/Controllers/BaseController.php @@ -47,9 +47,19 @@ protected function addPaginator(array $data, WP_Query $query): array */ protected function getPaginatorParams(WP_REST_Request $request, int $limit = 10): array { - return [ + return array_merge($this->getTaxonomyParams($request), [ 'posts_per_page' => $request->get_param('limit') ?: $limit, 'paged' => $request->get_param('page') ?: 0 - ]; + ]); + } + + /** + * Get the request params WP_Query turns into a tax_query for OpenPub taxonomies, e.g. ?openpub-type=slug. + */ + protected function getTaxonomyParams(WP_REST_Request $request): array + { + $queryVars = array_filter(wp_list_pluck(get_object_taxonomies('openpub-item', 'objects'), 'query_var')); + + return array_intersect_key($request->get_params(), array_flip($queryVars)); } } From f0021c17b39b5681563eb53bc2521b03d97a0466 Mon Sep 17 00:00:00 2001 From: rivanuff <16398970+rivanuff@users.noreply.github.com> Date: Thu, 12 Nov 2026 11:17:57 +0100 Subject: [PATCH 2/2] release: v3.9.6 --- CHANGELOG.md | 4 ++++ openpub-base.php | 2 +- src/Base/Foundation/Plugin.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a3cbc0..ab08cc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [v3.9.6] - 2026-11-12 + +- Fix: allow OpenPub taxonomy filter params in REST API queries + ## [v3.9.5] - 2026-10-30 - Fix: don't propagate all query params to paginator params diff --git a/openpub-base.php b/openpub-base.php index ddea235..328d2bc 100644 --- a/openpub-base.php +++ b/openpub-base.php @@ -4,7 +4,7 @@ * Plugin Name: Yard | OpenPub Base * Plugin URI: https://www.openwebconcept.nl/ * Description: Acts as foundation for other OpenPub related content plugins. This plugin implements actions to allow for other plugins to add and/or change Custom Posttypes, Metaboxes, Taxonomies, en Posts 2 posts relations. - * Version: 3.9.5 + * Version: 3.9.6 * Author: Yard | Digital Agency * Author URI: https://www.yard.nl/ * License: GPL-3.0 diff --git a/src/Base/Foundation/Plugin.php b/src/Base/Foundation/Plugin.php index 9285464..cc8f059 100644 --- a/src/Base/Foundation/Plugin.php +++ b/src/Base/Foundation/Plugin.php @@ -8,7 +8,7 @@ class Plugin { public const NAME = 'openpub-base'; - public const VERSION = '3.9.5'; + public const VERSION = '3.9.6'; protected string $rootPath; public Config $config;