[ Index ]

PHP Cross Reference of WordPress




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

Blocks API: WP_Block_Type class

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

Defines 1 class

WP_Block_Type:: (6 methods):

Class: WP_Block_Type  - X-Ref

Core class representing a block type.

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

Will populate object properties from the provided arguments.

since: 5.0.0
since: 5.5.0 Added the `title`, `category`, `parent`, `icon`, `description`,
since: 5.6.0 Added the `api_version` property.
since: 5.8.0 Added the `variations` property.
since: 5.9.0 Added the `view_script` property.
param: string       $block_type Block type name including namespace.
param: array|string $args       {

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

since: 5.0.0
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.

since: 5.0.0
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.

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

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

since: 5.0.0
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.

since: 5.0.0
return: array Array of attributes.

Generated: Mon Dec 6 01:00:03 2021 Cross-referenced by PHPXref 0.7.1