W3cubDocs

/WordPress

WP_Block_List::offsetGet( $offset )

Source

public function offsetGet( $offset ) {
	$block = $this->blocks[ $offset ];

	if ( isset( $block ) && is_array( $block ) ) {
		$block = new WP_Block( $block, $this->available_context, $this->registry );

		$this->blocks[ $offset ] = $block;
	}

	return $block;
}

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_block_list/offsetget