#[Supports]

Attribute on classes.

use Saij\WpAppFramework\Block\Supports;

Block supports of a #[Block] class. The defaults are those of WordPress; only differing values are registered. html is always disabled, because blocks store no markup.

Arguments

#[Supports(bool $contentRole = false, bool $anchor = false, array $align = [], bool $customClassName = true, bool $multiple = true, bool $reusable = true, bool $inserter = true, bool $lock = true, bool $renaming = true, bool $customCSS = true)]
ParameterTypeDefaultDescription
contentRoleboolfalseContainer blocks: allows inserting inner blocks in contentOnly mode.
anchorboolfalseAn HTML anchor (id) editors can set in the advanced panel.
alignlist<Align>[]Allowed alignments; empty disables the support.
customClassNamebooltrueThe field "Additional CSS class(es)" in the advanced panel.
multiplebooltrueFalse allows the block only once per post.
reusablebooltrueFalse prevents turning the block into a synced pattern.
inserterbooltrueFalse hides the block from the inserter; it can still be used in templates, patterns and inner block templates.
lockbooltrueFalse hides the lock controls of the block.
renamingbooltrueFalse prevents editors from renaming the block in the list view.
customCSSbooltrueFree CSS per block instance for users with edit_css, stored in the style attribute; the theme decides whether it allows it.