[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

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

Blocks API: WP_Block_Type class

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

Defines 1 class

WP_Block_Type:: (6 methods):
  __construct()
  render()
  is_dynamic()
  prepare_attributes_for_render()
  set_props()
  get_attributes()


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       Optional. Array or string of arguments for registering a block type.

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

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

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: boolean Whether block type is dynamic.

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

param: array $attributes Original block attributes.
return: array             Prepared 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.



Generated: Sat Nov 23 20:47:33 2019 Cross-referenced by PHPXref 0.7