WP_Block_Parser_Block::__construct()publicWP 5.0.0

Constructor.

Will populate object properties from the provided arguments.

Method of the class: WP_Block_Parser_Block{}

No Hooks.

Return

null. Nothing (null).

Usage

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

Changelog

Since 5.0.0 Introduced.

WP_Block_Parser_Block::__construct() code WP 6.5.2

public function __construct( $name, $attrs, $inner_blocks, $inner_html, $inner_content ) {
	$this->blockName    = $name;          // phpcs:ignore WordPress.NamingConventions.ValidVariableName
	$this->attrs        = $attrs;
	$this->innerBlocks  = $inner_blocks;  // phpcs:ignore WordPress.NamingConventions.ValidVariableName
	$this->innerHTML    = $inner_html;    // phpcs:ignore WordPress.NamingConventions.ValidVariableName
	$this->innerContent = $inner_content; // phpcs:ignore WordPress.NamingConventions.ValidVariableName
}