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
register_core_block_style_handles()
block_type_metadata
register_legacy_post_comments_block()
block_type_metadata
wp-includes/blocks.php 447
$metadata = apply_filters( 'block_type_metadata', $metadata );
wp-includes/blocks/index.php 119
$schema = apply_filters( 'block_type_metadata', $schema );
wp-includes/blocks/comments.php 211
$metadata = apply_filters( 'block_type_metadata', $metadata );

Where the hook is used in WordPress

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