WP_Block_Parser_Frame::__construct( WP_Block_Parser_Block $block, int $token_start, int $token_length, int $prev_offset = null, int $leading_html_start = null )

In this article

Constructor

Description

Will populate object properties from the provided arguments.

Parameters

$blockWP_Block_Parser_Blockrequired
Full or partial block.
$token_startintrequired
Byte offset into document for start of parse token.
$token_lengthintrequired
Byte length of entire parse token string.
$prev_offsetintoptional
Byte offset into document for after parse token ends.

Default:null

$leading_html_startintoptional
Byte offset into document where leading HTML before token starts.

Default:null

Source

public function __construct( $block, $token_start, $token_length, $prev_offset = null, $leading_html_start = null ) {
	$this->block              = $block;
	$this->token_start        = $token_start;
	$this->token_length       = $token_length;
	$this->prev_offset        = isset( $prev_offset ) ? $prev_offset : $token_start + $token_length;
	$this->leading_html_start = $leading_html_start;
}

Changelog

VersionDescription
5.0.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.