Skip to content

Commit

Permalink
(feat): get all connected items in API response instead of the defaul…
Browse files Browse the repository at this point in the history
…t 10
  • Loading branch information
Mike van den Hoek committed Jun 20, 2024
1 parent 20001b8 commit 187f493
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## Version [3.12.1] (2024-06-20)

### Feat

- Get all connected items in API response instead of the default 10.

## Version [3.12] (2024-03-14)

### Feat
Expand Down
2 changes: 1 addition & 1 deletion pdc-base.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: Yard | PDC Base
* Plugin URI: https://www.openwebconcept.nl/
* Description: Acts as foundation for other PDC 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.12
* Version: 3.12.1
* 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 @@ -19,7 +19,7 @@ class Plugin
*
* @var string
*/
public const VERSION = '3.12';
public const VERSION = '3.12.1';

/**
* Path to the root of the plugin.
Expand Down
10 changes: 6 additions & 4 deletions src/Base/RestAPI/SharedFields/ItemsField.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

namespace OWC\PDC\Base\RestAPI\SharedFields;

use WP_Post;
use OWC\PDC\Base\Support\Traits\QueryHelpers;
use OWC\PDC\Base\Support\Traits\CheckPluginActive;
use OWC\PDC\Base\RestAPI\ItemFields\ConnectedField;
use OWC\PDC\Base\Support\Traits\CheckPluginActive;
use OWC\PDC\Base\Support\Traits\QueryHelpers;
use WP_Post;

/**
* Adds connected fields to item in API.
Expand All @@ -36,7 +36,9 @@ public function create(WP_Post $post): array

protected function extraQueryArgs(string $type): array
{
$query = [];
$query = [
'p2p:per_page' => -1
];

$query = array_merge_recursive($query, $this->excludeInactiveItemsQuery());

Expand Down

0 comments on commit 187f493

Please sign in to comment.