Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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 = '',
Expand Down Expand Up @@ -739,6 +755,7 @@ public function toJson(): string
'render_callback',
'use_post_meta',
'validate',
'allowed_blocks',
]);

return $settings->filter()->toJson(JSON_PRETTY_PRINT);
Expand Down