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

  • (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. If providing the path to a JSON file, the filename must end with `block.json`.
  • (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.
  • (WP_Block_Type|false) The registered block type on success, or false on failure.
Defined at:
Change Log:
  • 5: .
  • 5: .
  • 6: .
  • 6: .
  • 6: .
  • 6: .


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

Related Functions

register_core_block_types_from_metadata, register_block_core_comment_date, register_block_type, register_block_core_comments, register_term_meta

Top Google Results

User discussions

wpseek mobile