Home / APIs / WP_Block_Parser::parse() – Parses a document and returns a list of block structures

You appear to be a bot. Output may be restricted

Description

Parses a document and returns a list of block structures

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.

Usage

$WP_Block_Parser_Block[] = WP_Block_Parser::parse( $document );

Parameters

$document
( string ) required – Input document being parsed.

Returns

WP_Block_Parser_Block[]

Source

File name: wordpress/wp-includes/class-wp-block-parser.php


Lines: 1 to 14 of 14

  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;
  }
 

 View on GitHub View on Trac

Published: 7th December 2018 | Last updated: 10th January 2019

Information

Function name: WP_Block_Parser::parse
Class ref: WP_Block_Parser
Plugin ref: WordPress
Version: 5.0.3
Sourcefile: wp-includes/class-wp-block-parser.php
File ref: wp-includes/class-wp-block-parser.php
Deprecated?: No
API Letters: B,P,W

  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Files
  • Hooks
  • Classes
  • Sites
  • Sitemap
  • Blog
WooCommerce a2z WooCommerce a2z
WooCommerce

Site:  woocommerce.wp-a2z.org
© Copyright WooCommerce a2z 2014-2019. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins