wpseek.com
WordPress开发者和主题制作者的搜索引擎
wp_register_block_types_from_metadata_collection › WordPress Function
Since6.8.0
已弃用n/a
› wp_register_block_types_from_metadata_collection ( $path, $manifest = '' )
| 参数: (2) |
|
| 查看: | |
| 定义在: |
|
| 文档: |
Registers all block types from a block metadata collection.
This can either reference a previously registered metadata collection or, if the$manifest parameter is provided,
register the metadata collection directly within the same function call.源码
function wp_register_block_types_from_metadata_collection( $path, $manifest = '' ) {
if ( $manifest ) {
wp_register_block_metadata_collection( $path, $manifest );
}
$block_metadata_files = WP_Block_Metadata_Registry::get_collection_block_metadata_files( $path );
foreach ( $block_metadata_files as $block_metadata_file ) {
register_block_type_from_metadata( $block_metadata_file );
}
}