Will populate object properties from the provided arguments.
Parameters
$block_typestring
Block type name including namespace.
$argsarray|stringoptional
Array or string of arguments for registering a block type. Any arguments may be defined, however the ones described below are supported by default. Default empty array.Default: array()
$api_versionstring
Block API version.
$titlestring
Human-readable block type label.
$categorystring|null
Block type category classification, used in search interfaces to arrange block types by category.
$parentstring[]|null
Setting parent lets a block require that it is only available when nested within the specified blocks.
$ancestorstring[]|null
Setting ancestor makes a block available only inside the specified block types at any position of the ancestor's block subtree.
$allowed_blocksstring[]|null
Limits which block types can be inserted as children of this block type.
$iconstring|null
Block type icon.
$descriptionstring
A detailed block type description.
$keywordsstring[]
Additional keywords to produce block type as result in search interfaces.
$textdomainstring|null
The translation textdomain.
$stylesarray[]
Alternative block styles.
$variationsarray[]
Block variations.
$selectorsarray
Custom CSS selectors for theme.json style generation.
Signature, return type and hooks compared across 5 parsed releases.
6.5.0
Added the allowed_blocks, variation_callback, and view_style_handles properties.from the docblock
6.4.0
Added the block_hooks property.from the docblock
6.3.0
Added the selectors property.from the docblock
6.1.0
Added the editor_script_handles, script_handles, view_script_handles, editor_style_handles, and style_handles properties. Deprecated the editor_script, script, view_script, editor_style, and style properties.from the docblock
6.0.0
Added the ancestor property.from the docblock
5.9.0
Added the view_script property.from the docblock
5.8.0
Added the variations property.from the docblock
5.6.0
Added the api_version property.from the docblock
5.5.0
Added the title, category, parent, icon, description, keywords, textdomain, styles, supports, example, uses_context, and provides_context properties.from the docblock
5.0.0
Introduced.from the docblock
About this page
Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/class-wp-block-type.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.