WP_Block_List::offsetExists()publicWP 5.5.0ReturnTypeWillChange

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

Method of the class: WP_Block_List{}

No Hooks.

Return

true|false. Whether block exists.

Usage

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

Changelog

Since 5.5.0 Introduced.

WP_Block_List::offsetExists() code WP 6.5.2

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