block_type_metadata filter-hookWP 1.0

Filters the metadata object, the same way it's done inside register_block_type_from_metadata(). This applies some default filters, like _wp_multiple_block_styles, which is required in this case because the block has multiple styles.

Usage

add_filter( 'block_type_metadata', 'wp_kama_block_type_metadata_filter' );

/**
 * Function for `block_type_metadata` filter-hook.
 * 
 * @param  $metadata 
 *
 * @return 
 */
function wp_kama_block_type_metadata_filter( $metadata ){

	// filter...
	return $metadata;
}
$metadata
-

Where the hook is called

register_legacy_post_comments_block()
block_type_metadata
register_block_type_from_metadata()
block_type_metadata
wp-includes/blocks/comments.php 216
$metadata = apply_filters( 'block_type_metadata', $metadata );
wp-includes/blocks.php 354
$metadata = apply_filters( 'block_type_metadata', $metadata );

Where the hook is used in WordPress

wp-includes/default-filters.php 233
add_filter( 'block_type_metadata', 'wp_migrate_old_typography_shape' );