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.3

- Feat: getShowOnPortalURL(): add filter and sorting for portalUrls by numeric blogId with taxonomy 'openpub-show-on'

## v3.7.2

- Refactor: register rest routes in correct order
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.2
* Version: 3.7.3
* 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.2';
public const VERSION = '3.7.3';

protected string $rootPath;
public Config $config;
Expand Down
10 changes: 10 additions & 0 deletions src/Base/Models/PortalLinkGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ private function getShowOnPortalURL(): string
return '';
}

// Filter out terms where slug is not numeric
$terms = array_filter($terms, function($term) {
return is_numeric($term->slug);
});

// Sort terms by slug (blog ID)
usort($terms, function($a, $b) {
return intval($a->slug) <=> intval($b->slug);
});

$portalURL = reset($terms);

if (isset($_GET['source'])) {
Expand Down
Loading