class BlockParserBlock in Gutenberg 8.2
Class BlockParserBlock.
This class was ported from the WordPress code.
@link https://github.com/WordPress/WordPress for the canonical source repository @copyright Copyright (c) 2011-2020 WordPress - Web publishing software. @license https://github.com/WordPress/WordPress/blob/master/license.txt GNU General Public License.
Holds the block structure in memory.
@since 3.8.0
Hierarchy
- class \Drupal\gutenberg\Parser\BlockParserBlock
Expanded class hierarchy of BlockParserBlock
See also
https://github.com/WordPress/WordPress/blob/master/wp-includes/class-wp-...
File
- src/
Parser/ BlockParserBlock.php, line 19
Namespace
Drupal\gutenberg\ParserView source
class BlockParserBlock {
/**
* Name of block.
*
* @var string
* @since 3.8.0
* @example "core/paragraph"
*/
public $blockName;
/**
* Optional set of attributes from block comment delimiters.
*
* @var array|null
* @example array( 'columns' => 3 )
*
* @since 3.8.0
*/
public $attrs;
/**
* List of inner blocks (of this same class)
*
* @var BlockParserBlock[]
* @since 3.8.0
*/
public $innerBlocks;
/**
* HTML from inside block comment delimiters after removing inner blocks.
*
* @var string
* @since 3.8.0
* @example "...Just <!-- wp:test /--> testing..." -> "Just testing..."
*/
public $innerHTML;
/**
* List of string fragments and null markers where inner blocks were found.
*
* @var array
* @since 4.2.0
* @example array(
* 'innerHTML' => 'BeforeInnerAfter',
* 'innerBlocks' => array( block, block ),
* 'innerContent' => array( 'Before', null, 'Inner', null, 'After' ),
* )
*/
public $innerContent;
/**
* Constructor.
*
* Will populate object properties from the provided arguments.
*
* @param string $name
* Name of block.
* @param array $attrs
* Optional set of attributes from block comment delimiters.
* @param array $inner_blocks
* List of inner blocks (of this same class).
* @param string $inner_html
* Resultant HTML from inside block comment delimiters after
* removing inner blocks.
* @param array $inner_content
* List of string fragments and null markers where inner blocks were found.
*
* @since 3.8.0
*/
public function __construct($name, array $attrs, array $inner_blocks, $inner_html, array $inner_content) {
$this->blockName = $name;
$this->attrs = $attrs;
$this->innerBlocks = $inner_blocks;
$this->innerHTML = $inner_html;
$this->innerContent = $inner_content;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BlockParserBlock:: |
public | property | Optional set of attributes from block comment delimiters. | |
BlockParserBlock:: |
public | property | Name of block. | |
BlockParserBlock:: |
public | property | List of inner blocks (of this same class) | |
BlockParserBlock:: |
public | property | List of string fragments and null markers where inner blocks were found. | |
BlockParserBlock:: |
public | property | HTML from inside block comment delimiters after removing inner blocks. | |
BlockParserBlock:: |
public | function | Constructor. |