This documentation describes unreleased changes on the main branch.

#[InnerBlocks]

Attribute on classes.

use Saij\WpAppFramework\Block\InnerBlocks;

How the editor handles the inner blocks of a container block (a block whose render() accepts string $content). Without this attribute all blocks are allowed and WordPress' defaults apply.

Arguments

#[InnerBlocks(?array $allowed = null, ?array $template = null, ?TemplateLock $templateLock = null, ?Orientation $orientation = null, ?TemplateBlock $defaultBlock = null, bool $directInsert = false, array $prioritized = [], Appender $appender = Appender::Default)]
ParameterTypeDefaultDescription
allowedlist<class-string|CoreBlock|string>|nullnullBlocks that may be inserted: block classes of the same theme or plugin, core blocks, other blocks by full name ("acme/slider"); null allows all.
templatelist<TemplateBlock>|nullnullInner blocks of a newly inserted block.
templateLockTemplateLock|nullnullNull inherits the lock of the parent.
orientationOrientation|nullnullDirection in which the inner blocks are laid out, for the movers and the drop indicator of the editor; null for the default of WordPress.
defaultBlockTemplateBlock|nullnullBlock the appender inserts (with $directInsert) and the editor suggests.
directInsertboolfalseThe appender inserts $defaultBlock without asking.
prioritizedlist<class-string|CoreBlock|string>[]Blocks offered first in the quick inserter of the container and by the slash command.
appenderAppenderAppender::DefaultThe element at the end of the inner blocks for adding another block.