block_type_metadata filter-hookWP 5.7.0

Filters the metadata provided for registering a block type.

Usage

add_filter( 'block_type_metadata', 'wp_kama_block_type_metadata_filter' );

/**
 * Function for `block_type_metadata` filter-hook.
 * 
 * @param array $metadata Metadata for registering a block type.
 *
 * @return array
 */
function wp_kama_block_type_metadata_filter( $metadata ){

	// filter...
	return $metadata;
}
$metadata(array)
Metadata for registering a block type.

Changelog

Since 5.7.0 Introduced.

Where the hook is called

register_block_type_from_metadata()
block_type_metadata
wp-includes/blocks.php 251
$metadata = apply_filters( 'block_type_metadata', $metadata );

Where the hook is used in WordPress

wp-includes/blocks.php 1330
add_filter( 'block_type_metadata', '_wp_multiple_block_styles' );
wp-includes/default-filters.php 221
add_filter( 'block_type_metadata', 'wp_migrate_old_typography_shape' );