WP_Block_List::offsetSet( int $offset, array|WP_Block $value )

In this article

Assign a block value by the specified block offset.

Parameters

$offsetintrequired
Offset of block value to set.
$valuearray|WP_Blockrequired
Block value.

Source

#[ReturnTypeWillChange]
public function offsetSet( $offset, $value ) {
	if ( is_null( $offset ) ) {
		$this->blocks[] = $value;
	} else {
		$this->blocks[ $offset ] = $value;
	}
}

Changelog

VersionDescription
5.5.0Introduced.

User Contributed Notes

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