Title: WP_Block_List::offsetGet
Published: August 11, 2020
Last modified: February 24, 2026

---

# WP_Block_List::offsetGet( $offset )

## In this article

 * [Source](https://developer.wordpress.org/reference/classes/wp_block_list/offsetget/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_block_list/offsetget/?output_format=md#related)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_block_list/offsetget/?output_format=md#wp--skip-link--target)

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_block_list/offsetget/?output_format=md#source)󠁿

    ```php
    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;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-block-list.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/class-wp-block-list.php#L89)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/class-wp-block-list.php#L89-L99)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_block_list/offsetget/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_Block::__construct()](https://developer.wordpress.org/reference/classes/wp_block/__construct/)`wp-includes/class-wp-block.php` |

Constructor.

  |

| Used by | Description | 
| [WP_Block_List::current()](https://developer.wordpress.org/reference/classes/wp_block_list/current/)`wp-includes/class-wp-block-list.php` |  |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_block_list%2Foffsetget%2F)
before being able to contribute a note or feedback.