Changeset 59874 for trunk/src/wp-includes/blocks.php
- Timestamp:
- 02/26/2025 07:38:08 PM (15 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/blocks.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks.php
r59866 r59874 374 374 375 375 return $i18n_block_schema; 376 } 377 378 /** 379 * Registers all block types from a block metadata collection. 380 * 381 * This can either reference a previously registered metadata collection or, if the `$manifest` parameter is provided, 382 * register the metadata collection directly within the same function call. 383 * 384 * @since 6.8.0 385 * @see wp_register_block_metadata_collection() 386 * @see register_block_type_from_metadata() 387 * 388 * @param string $path The absolute base path for the collection ( e.g., WP_PLUGIN_DIR . '/my-plugin/blocks/' ). 389 * @param string $manifest Optional. The absolute path to the manifest file containing the metadata collection, in 390 * order to register the collection. If this parameter is not provided, the `$path` parameter 391 * must reference a previously registered block metadata collection. 392 */ 393 function wp_register_block_types_from_metadata_collection( $path, $manifest = '' ) { 394 if ( $manifest ) { 395 wp_register_block_metadata_collection( $path, $manifest ); 396 } 397 398 $block_metadata_files = WP_Block_Metadata_Registry::get_collection_block_metadata_files( $path ); 399 foreach ( $block_metadata_files as $block_metadata_file ) { 400 register_block_type_from_metadata( $block_metadata_file ); 401 } 376 402 } 377 403
Note: See TracChangeset
for help on using the changeset viewer.