From 5b53175d0add02b9a1966fb6a353ee9497e0491b Mon Sep 17 00:00:00 2001 From: Brandon Date: Wed, 2 Apr 2025 09:52:27 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Re-separate=20api=20version=20an?= =?UTF-8?q?d=20block=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Block.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Block.php b/src/Block.php index c44d498f..662a8cf7 100644 --- a/src/Block.php +++ b/src/Block.php @@ -277,6 +277,13 @@ abstract class Block extends Composer implements BlockContract */ public $apiVersion = null; + /** + * The internal ACF block version. + * + * @var int + */ + public $blockVersion = 2; + /** * Validate block fields as per the field group configuration. * @@ -645,7 +652,7 @@ public function settings(): Collection 'styles' => $this->getStyles(), 'supports' => $this->getSupports(), 'textdomain' => $this->getTextDomain(), - 'acf_block_version' => $this->getApiVersion(), + 'acf_block_version' => $this->blockVersion, 'apiVersion' => $this->getApiVersion(), 'validate' => $this->validate, 'use_post_meta' => $this->usePostMeta, @@ -701,7 +708,7 @@ public function toJson(): string $settings = $this->settings() ->put('name', $this->namespace) ->put('acf', [ - 'blockVersion' => $this->getApiVersion(), + 'blockVersion' => $this->blockVersion, 'mode' => $this->mode, 'postTypes' => $this->post_types, 'renderTemplate' => $this::class,