From 353d6e2c39aaea39ad7f7c657bdf2fdcf95a1b47 Mon Sep 17 00:00:00 2001 From: NiclasNorin Date: Tue, 30 Sep 2025 13:18:32 +0200 Subject: [PATCH] fix: correct get id for blocks --- source/php/Module.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/php/Module.php b/source/php/Module.php index 67b04dac3..49afef1db 100644 --- a/source/php/Module.php +++ b/source/php/Module.php @@ -188,6 +188,7 @@ public function __construct( $this->args = $args; $this->ID = $post->ID ?? null; + $this->mode = $this->ID ? 'module' : 'block'; $this->postStatus = $post->post_status ?? 'publish'; @@ -346,9 +347,10 @@ protected function getID(): int|string|null * Get metadata for block or module. * @return array */ - protected function getFields() { + protected function getFields(): array + { $this->dataFetched = true; - return AcfService::get()->getFields($this->getID()) ?: []; + return AcfService::get()->getFields($this->mode === 'module' ? $this->getID() : []) ?: []; } private function getBlockNamesFromPage(): array