WP_Block_Parser_Block::__construct( string $name, array $attrs, array $inner_blocks, string $inner_html, array $inner_content )

In this article

Constructor.

Description

Will populate object properties from the provided arguments.

Parameters

$namestringrequired
Name of block.
$attrsarrayoptional
Optional set of attributes from block comment delimiters.
$inner_blocksarrayoptional
List of inner blocks (of this same class).
$inner_htmlstringoptional
Resultant HTML from inside block comment delimiters after removing inner blocks.
$inner_contentarrayoptional
List of string fragments and null markers where inner blocks were found.

Source

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
}

Changelog

VersionDescription
5.0.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.