WP_Block_List::offsetSet()publicWP 5.5.0ReturnTypeWillChange

Assign a block value by the specified block offset.

Method of the class: WP_Block_List{}

No Hooks.

Return

null. Nothing (null).

Usage

$WP_Block_List = new WP_Block_List();
$WP_Block_List->offsetSet( $offset, $value );
$offset(string) (required)
Offset of block value to set.
$value(mixed) (required)
Block value.

Changelog

Since 5.5.0 Introduced.

WP_Block_List::offsetSet() code WP 6.5.2

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