WordPress at Your Fingertips
function is not described

WP_Block_List::offsetExists() public WP 5.5.0

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

{} It's a method of the class: WP_Block_List{}

No Hooks.


true|false. Whether block exists.


$WP_Block_List = new WP_Block_List();
$WP_Block_List->offsetExists( $index );
$index(string) (required)
Index of block to check.


Since 5.5.0 Introduced.

Code of WP_Block_List::offsetExists() WP 5.8.1

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