W3cubDocs

/WordPress

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

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

Version Description
5.0.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_block_parser_block/__construct