Summery Summery
Parses a document and returns a list of block structures
Syntax Syntax
Description Description
When encountering an invalid parse will return a best-effort parse. In contrast to the specification parser this does not return an error on invalid inputs.
Parameters Parameters
- $document
-
(Required) Input document being parsed.
Return Return
Source Source
File: wp-includes/class-wp-block-parser.php
function parse( $document ) {
$this->document = $document;
$this->offset = 0;
$this->output = array();
$this->stack = array();
$this->empty_attrs = json_decode( '{}', true );
do {
// twiddle our thumbs.
} while ( $this->proceed() );
return $this->output;
}
Advertisement
Changelog Changelog
| Version | Description |
|---|---|
| 3.8.0 | Introduced. |