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. 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.
Returns:- (WP_Block_Type|false) The registered block type on success, or false on failure.
Defined at:Change Log:- 5: .
- 5: .
- 6: .
- 6: .
- 6: .
- 6: .
- 6: .
- Introduced in WordPress: 5.5.0
- Deprecated in WordPress: —
Description
Registers a block type from the metadata stored in the `block.json` file.