WordPress at Your Fingertips
function is not described

WP_Block_Parser_Block::__construct() public WP 5.0.0


Will populate object properties from the provided arguments.

{} It's a method of the class: WP_Block_Parser_Block{}

No Hooks.


null. Nothing.


$WP_Block_Parser_Block = new WP_Block_Parser_Block();
$WP_Block_Parser_Block->__construct( $name, $attrs, $innerBlocks, $innerHTML, $innerContent );
$name(string) (required)
Name of block.
$attrs(array) (required)
Optional set of attributes from block comment delimiters.
$innerBlocks(array) (required)
List of inner blocks (of this same class).
$innerHTML(string) (required)
Resultant HTML from inside block comment delimiters after removing inner blocks.
$innerContent(array) (required)
List of string fragments and null markers where inner blocks were found.


Since 5.0.0 Introduced.

Code of WP_Block_Parser_Block::__construct() WP 5.7.2

function __construct( $name, $attrs, $innerBlocks, $innerHTML, $innerContent ) {
	$this->blockName    = $name;
	$this->attrs        = $attrs;
	$this->innerBlocks  = $innerBlocks;
	$this->innerHTML    = $innerHTML;
	$this->innerContent = $innerContent;