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`. See WP_Block_Type::__construct() for information on accepted arguments. Default empty array.
Returns:
  • (WP_Block_Type|false) The registered block type on success, or false on failure.
Defined at:
Change Log:
  • 5: .
  • 5: .

Description

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

Related Functions

register_core_block_types_from_metadata, register_block_type, register_block_core_post_date, register_term_meta, register_block_style_handle

Top Google Results

User discussions

wpseek mobile