Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v3.7.6

- Feat: add taxonomies to API added through apply_filter

## v3.7.5

- Feat: add author id in API response of items endpoint
Expand Down
2 changes: 1 addition & 1 deletion openpub-base.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.7.5
* Version: 3.7.6
* Author: Yard | Digital Agency
* Author URI: https://www.yard.nl/
* License: GPL-3.0
Expand Down
2 changes: 1 addition & 1 deletion src/Base/Foundation/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class Plugin
{
public const NAME = 'openpub-base';
public const VERSION = '3.7.5';
public const VERSION = '3.7.6';

protected string $rootPath;
public Config $config;
Expand Down
12 changes: 10 additions & 2 deletions src/Base/RestAPI/ItemFields/TaxonomyField.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@ class TaxonomyField extends CreatesFields
*/
public function create(WP_Post $post): array
{
$result = [];
$result = [];

foreach (array_keys($this->plugin->config->get('taxonomies')) as $taxonomy) {
$taxonomies = apply_filters('owc/openpub-base/before-register-extended-taxonomies', $this->plugin->config->get('taxonomies'));

if (! is_array($taxonomies) || 1 > count($taxonomies)) {
return $result;
}

$taxonomiesKeys = array_unique(array_keys($taxonomies));

foreach ($taxonomiesKeys as $taxonomy) {
$result[$taxonomy] = $this->getTerms($post->ID, $taxonomy);
}

Expand Down
Loading