diff --git a/src/Block.php b/src/Block.php index c82f58b..ece0860 100644 --- a/src/Block.php +++ b/src/Block.php @@ -263,6 +263,13 @@ abstract class Block extends Composer implements BlockContract */ public $template = []; + /** + * The allowed inner blocks. + * + * @var array + */ + public $allowed_blocks = []; + /** * Determine whether to save the block's data as post meta. * @@ -412,6 +419,14 @@ public function getSupports(): array return $supports->all(); } + /** + * Retrieve the allowed inner blocks. + */ + public function getAllowedBlocks(): array + { + return $this->allowed_blocks; + } + /** * Retrieve the block support attributes. */ @@ -668,6 +683,7 @@ public function settings(): Collection 'api_version' => $this->getApiVersion(), 'validate' => $this->validate, 'use_post_meta' => $this->usePostMeta, + 'allowed_blocks' => $this->getAllowedBlocks(), 'render_callback' => function ( $block, $content = '', @@ -739,6 +755,7 @@ public function toJson(): string 'render_callback', 'use_post_meta', 'validate', + 'allowed_blocks', ]); return $settings->filter()->toJson(JSON_PRETTY_PRINT);