WP_Block_List::offsetExists │ public │ WP 5.5.0 │ ReturnTypeWillChange

Returns true if a block exists by the specified block offset, or false otherwise.

Method of the class: WP_Block_List{}

No Hooks.

Returns

bool. Whether block exists.

Usage

$WP_Block_List = new WP_Block_List();
$WP_Block_List->offsetExists( $offset );
$offset(int) (required)
Offset of block to check for.

Changelog

Since 5.5.0 Introduced.

WP_Block_List::offsetExists() code WP 7.1.4

public function offsetExists( $offset ) {
	return isset( $this->blocks[ $offset ] );
}