diff --git a/plugins/rest/lib/rest/route.php b/plugins/rest/lib/rest/route.php index 227e164d..2e657f0e 100644 --- a/plugins/rest/lib/rest/route.php +++ b/plugins/rest/lib/rest/route.php @@ -221,10 +221,15 @@ public function handleRequest(array $paths, array $get) $data = []; if ($instances) { foreach ($instances as $instance) { - $data[] = $this->getInstanceData( + $instance_data = $this->getInstanceData( $instance, array_merge($paths, [$instance->getId()]) ); + if (is_callable($this->getItemFunc)) { + $instance_data = call_user_func($this->getItemFunc, $this, $instance_data); + } + + $data[] = $instance_data; } if ($baseInstances) { $links = [];