[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

Blocks API: WP_Block class

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

Defines 1 class

WP_Block:: (3 methods):
  __construct()
  __get()
  render()


Class: WP_Block  - X-Ref

Class representing a parsed instance of a block.

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

Populates object properties from the provided block instance argument.

The given array of context values will not necessarily be available on
the instance itself, but is treated as the full set of values provided by
the block's ancestry. This is assigned to the private `available_context`
property. Only values which are configured to consumed by the block via
its registered type will be assigned to the block's `context` property.

since: 5.5.0
param: array                  $block             Array of parsed block properties.
param: array                  $available_context Optional array of ancestry context values.
param: WP_Block_Type_Registry $registry          Optional block type registry.

__get( $name )   X-Ref
Returns a value from an inaccessible property.

This is used to lazily initialize the `attributes` property of a block,
such that it is only prepared with default attributes at the time that
the property is accessed. For all other inaccessible properties, a `null`
value is returned.

since: 5.5.0
return: array|null Prepared attributes, or null.
param: string $name Property name.

render( $options = array()   X-Ref
Generates the render output for the block.

since: 5.5.0
return: string Rendered block output.
param: array $options {



Generated: Fri Apr 26 01:00:03 2024 Cross-referenced by PHPXref 0.7.1