[ 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: 203 lines (4 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( $index )   X-Ref
Returns true if a block exists by the specified block index, or false
otherwise.

param: string $index Index of block to check.
return: bool Whether block exists.

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

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

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

param: string $index Index of block value to set.
param: mixed  $value Block value.

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

param: string $index Index 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 : Sat Oct 31 08:20:01 2020 Cross-referenced by PHPXref