[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

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

Blocks API: WP_Block_Type class

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

Defines 1 class

WP_Block_Type:: (11 methods):
  __construct()
  __get()
  __isset()
  __set()
  render()
  is_dynamic()
  prepare_attributes_for_render()
  set_props()
  get_attributes()
  get_variations()
  get_uses_context()


Class: WP_Block_Type  - X-Ref

Core class representing a block type.

__construct( $block_type, $args = array()   X-Ref
Constructor.

Will populate object properties from the provided arguments.

param: string       $block_type Block type name including namespace.
param: array|string $args       {

__get( $name )   X-Ref
Proxies getting values for deprecated properties for script and style handles for backward compatibility.
Gets the value for the corresponding new property if the first item in the array provided.

return: string|string[]|null|void The value read from the new property if the first item in the array provided,
param: string $name Deprecated property name.

__isset( $name )   X-Ref
Proxies checking for deprecated properties for script and style handles for backward compatibility.
Checks whether the corresponding new property has the first item in the array provided.

return: bool Returns true when for the new property the first item in the array exists,
param: string $name Deprecated property name.

__set( $name, $value )   X-Ref
Proxies setting values for deprecated properties for script and style handles for backward compatibility.
Sets the value for the corresponding new property as the first item in the array.
It also allows setting custom properties for backward compatibility.

param: string $name  Property name.
param: mixed  $value Property value.

render( $attributes = array()   X-Ref
Renders the block type output for given attributes.

return: string Rendered block type output.
param: array  $attributes Optional. Block attributes. Default empty array.
param: string $content    Optional. Block content. Default empty string.

is_dynamic()   X-Ref
Returns true if the block type is dynamic, or false otherwise. A dynamic
block is one which defers its rendering to occur on-demand at runtime.

return: bool Whether block type is dynamic.

prepare_attributes_for_render( $attributes )   X-Ref
Validates attributes against the current block schema, populating
defaulted and missing values.

return: array Prepared block attributes.
param: array $attributes Original block attributes.

set_props( $args )   X-Ref
Sets block type properties.

param: array|string $args Array or string of arguments for registering a block type.

get_attributes()   X-Ref
Get all available block attributes including possible layout attribute from Columns block.

return: array Array of attributes.

get_variations()   X-Ref
Get block variations.

return: array[]

get_uses_context()   X-Ref
Get block uses context.

return: string[]



Generated : Sat Dec 21 08:20:01 2024 Cross-referenced by PHPXref