Skip to content

Commit

Permalink
🔧 Add a configurable $apiVersion property to blocks (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
drbroad authored Feb 21, 2025
1 parent 5fe0cee commit ad347be
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,13 @@ abstract class Block extends Composer implements BlockContract
*/
public $blockVersion = 2;

/**
* The ACF block API version.
*
* @var int
*/
public $apiVersion = 2;

/**
* Validate block fields as per the field group configuration.
*
Expand Down Expand Up @@ -632,7 +639,7 @@ public function settings(): Collection
'supports' => $this->getSupports(),
'textdomain' => $this->getTextDomain(),
'acf_block_version' => $this->blockVersion,
'api_version' => 2,
'api_version' => $this->apiVersion,
'validate' => $this->validate,
'use_post_meta' => $this->usePostMeta,
'render_callback' => function (
Expand Down

0 comments on commit ad347be

Please sign in to comment.