[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/ -> class-wp-block-list.php (summary)

Blocks API: WP_Block_List class

File Size: 214 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_Block_List:: (11 methods):
  __construct()
  offsetExists()
  offsetGet()
  offsetSet()
  offsetUnset()
  rewind()
  current()
  key()
  next()
  valid()
  count()


Class: WP_Block_List  - X-Ref

Class representing a list of block instances.

__construct( $blocks, $available_context = array()   X-Ref
Constructor.

Populates object properties from the provided block instance argument.

param: array[]|WP_Block[]     $blocks            Array of parsed block data, or block instances.
param: array                  $available_context Optional array of ancestry context values.
param: WP_Block_Type_Registry $registry          Optional block type registry.

offsetExists( $offset )   X-Ref
Returns true if a block exists by the specified block offset, or false
otherwise.

param: string $offset Offset of block to check for.
return: bool Whether block exists.

offsetGet( $offset )   X-Ref
Returns the value by the specified block offset.

param: string $offset Offset of block value to retrieve.
return: mixed|null Block value if exists, or null.

offsetSet( $offset, $value )   X-Ref
Assign a block value by the specified block offset.

param: string $offset Offset of block value to set.
param: mixed  $value Block value.

offsetUnset( $offset )   X-Ref
Unset a block.

param: string $offset Offset of block value to unset.

rewind()   X-Ref
Rewinds back to the first element of the Iterator.


current()   X-Ref
Returns the current element of the block list.

return: mixed Current element.

key()   X-Ref
Returns the key of the current element of the block list.

return: mixed Key of the current element.

next()   X-Ref
Moves the current position of the block list to the next element.


valid()   X-Ref
Checks if current position is valid.


count()   X-Ref
Returns the count of blocks in the list.

return: int Block count.



Generated : Thu Nov 21 08:20:01 2024 Cross-referenced by PHPXref