Constructor.
Will populate object properties from the provided arguments.
$namestringrequired
$attrsarrayoptional
$inner_blocksarrayoptional
$inner_htmlstringoptional
$inner_contentarrayoptional
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
}
| 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