Skip to content

Commit c634e44

Browse files
authored
🩹 Re-separate api version and block version (#329)
1 parent 2a9673c commit c634e44

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Block.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,13 @@ abstract class Block extends Composer implements BlockContract
277277
*/
278278
public $apiVersion = null;
279279

280+
/**
281+
* The internal ACF block version.
282+
*
283+
* @var int
284+
*/
285+
public $blockVersion = 2;
286+
280287
/**
281288
* Validate block fields as per the field group configuration.
282289
*
@@ -645,7 +652,7 @@ public function settings(): Collection
645652
'styles' => $this->getStyles(),
646653
'supports' => $this->getSupports(),
647654
'textdomain' => $this->getTextDomain(),
648-
'acf_block_version' => $this->getApiVersion(),
655+
'acf_block_version' => $this->blockVersion,
649656
'apiVersion' => $this->getApiVersion(),
650657
'validate' => $this->validate,
651658
'use_post_meta' => $this->usePostMeta,
@@ -701,7 +708,7 @@ public function toJson(): string
701708
$settings = $this->settings()
702709
->put('name', $this->namespace)
703710
->put('acf', [
704-
'blockVersion' => $this->getApiVersion(),
711+
'blockVersion' => $this->blockVersion,
705712
'mode' => $this->mode,
706713
'postTypes' => $this->post_types,
707714
'renderTemplate' => $this::class,

0 commit comments

Comments
 (0)