WP_Block_List::offsetGet()
Returns the value by the specified block offset.
Method of the class: WP_Block_List{}
No Hooks.
Return
Mixed|null
. Block value if exists, or null.
Usage
$WP_Block_List = new WP_Block_List(); $WP_Block_List->offsetGet( $offset );
- $offset(string) (required)
- Offset of block value to retrieve.
Changelog
Since 5.5.0 | Introduced. |
WP_Block_List::offsetGet() WP Block List::offsetGet code WP 6.7.1
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; }