register_block_type_from_metadata


register_block_type_from_metadata ( $file_or_folder, $args = array() )

Parameters:
  • (string) file_or_folder Path to the JSON file with metadata definition for the block or path to the folder where the `block.json` file is located.
  • (array) args { Optional. Array of block type arguments. Accepts any public property of `WP_Block_Type`. Any arguments may be defined, however the ones described below are supported by default. Default empty array. @type callable $render_callback Callback used to render blocks of this block type. }
Returns:
  • (WP_Block_Type|bool) The registered block type on success, or false on failure.
Defined at:

Description

Registers a block type from metadata stored in the `block.json` file.

Related Functions

register_core_block_types_from_metadata, register_block_type, register_term_meta, unregister_block_type, register_block_style_handle

Top Google Results

User discussions

wpseek mobile