WP_Block_Parser::add_freeform

Advertisement

Summery Summery

Pushes a length of text from the input document to the output list as a freeform block.

Syntax Syntax

WP_Block_Parser::add_freeform( null $length = null )

Parameters Parameters

$length

(Optional) how many bytes of document text to output.

Default value: null

Source Source

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

	function add_freeform( $length = null ) {
		$length = $length ? $length : strlen( $this->document ) - $this->offset;

		if ( 0 === $length ) {
			return;
		}

		$this->output[] = (array) self::freeform( substr( $this->document, $this->offset, $length ) );
	}

Advertisement

Changelog Changelog

Changelog
Version Description
3.8.0 Introduced.

Advertisement

Leave a Reply