Skip to content

Commit d051035

Browse files
committed
(feat): add taxonomies added through apply_filter to the api
1 parent f8aadfd commit d051035

4 files changed

Lines changed: 11 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v3.7.6
4+
5+
- Feat: add taxonomies to API added through apply_filter
6+
37
## v3.7.5
48

59
- Feat: add author id in API response of items endpoint

openpub-base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Plugin Name: Yard | OpenPub Base
55
* Plugin URI: https://www.openwebconcept.nl/
66
* 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.
7-
* Version: 3.7.5
7+
* Version: 3.7.6
88
* Author: Yard | Digital Agency
99
* Author URI: https://www.yard.nl/
1010
* License: GPL-3.0

src/Base/Foundation/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class Plugin
99
{
1010
public const NAME = 'openpub-base';
11-
public const VERSION = '3.7.5';
11+
public const VERSION = '3.7.6';
1212

1313
protected string $rootPath;
1414
public Config $config;

src/Base/RestAPI/ItemFields/TaxonomyField.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ public function create(WP_Post $post): array
1414
{
1515
$result = [];
1616

17-
foreach (array_keys($this->plugin->config->get('taxonomies')) as $taxonomy) {
17+
$configTaxonomies = array_keys($this->plugin->config->get('taxonomies'));
18+
$filteredTaxonomies = array_keys(apply_filters('owc/openpub-base/before-register-extended-taxonomies', $this->plugin->config->get('taxonomies')));
19+
$allTaxonomies = array_unique(array_merge($configTaxonomies, $filteredTaxonomies));
20+
21+
foreach ($allTaxonomies as $taxonomy) {
1822
$result[$taxonomy] = $this->getTerms($post->ID, $taxonomy);
1923
}
2024

0 commit comments

Comments
 (0)