Title: WP_Block_Parser_Block::__construct
Published: August 8, 2023
Last modified: February 24, 2026

---

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

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/wp_block_parser_block/__construct/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/classes/wp_block_parser_block/__construct/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/classes/wp_block_parser_block/__construct/?output_format=md#source)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_block_parser_block/__construct/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_block_parser_block/__construct/?output_format=md#wp--skip-link--target)

Constructor.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/wp_block_parser_block/__construct/?output_format=md#description)󠁿

Will populate object properties from the provided arguments.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_block_parser_block/__construct/?output_format=md#parameters)󠁿

 `$name`stringrequired

Name of block.

`$attrs`arrayoptional

Optional set of attributes from block comment delimiters.

`$inner_blocks`arrayoptional

List of inner blocks (of this same class).

`$inner_html`stringoptional

Resultant HTML from inside block comment delimiters after removing inner blocks.

`$inner_content`arrayoptional

List of string fragments and null markers where inner blocks were found.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_block_parser_block/__construct/?output_format=md#source)󠁿

    ```php
    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
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-block-parser-block.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/class-wp-block-parser-block.php#L83)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/class-wp-block-parser-block.php#L83-L89)

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_block_parser_block/__construct/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_block_parser_block%2F__construct%2F)
before being able to contribute a note or feedback.