block_type_metadata хук-фильтрWP 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.

Использование

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
-

Где вызывается хук

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

Где используется хук в WordPress

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