File tree Expand file tree Collapse file tree
packages/create-block-interactive-template Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,9 +18,10 @@ module.exports = {
1818 viewScriptModule : 'file:./view.js' ,
1919 render : 'file:./render.php' ,
2020 example : { } ,
21+ folderName : './src/$slug' ,
2122 customScripts : {
22- build : 'wp-scripts build --experimental-modules' ,
23- start : 'wp-scripts start --experimental-modules' ,
23+ build : 'wp-scripts build --experimental-modules --blocks-manifest ' ,
24+ start : 'wp-scripts start --experimental-modules --blocks-manifest ' ,
2425 } ,
2526 } ,
2627 variants : {
Original file line number Diff line number Diff line change 3737if ( ! defined( 'ABSPATH' ) ) {
3838 exit; // Exit if accessed directly.
3939}
40-
4140/**
42- * Registers the block using the metadata loaded from the `block.json` file.
43- * Behind the scenes, it registers also all assets so they can be enqueued
41+ * Registers the block(s) metadata from the `blocks-manifest.php` and registers the block type(s)
42+ * based on the registered block metadata. Behind the scenes, it registers also all assets so they can be enqueued
4443 * through the block editor in the corresponding context.
4544 *
46- * @see https://developer.wordpress.org/reference/functions/register_block_type/
45+ * @see https://make.wordpress.org/core/2025/03/13/more-efficient-block-type-registration-in-6-8/
46+ * @see https://make.wordpress.org/core/2024/10/17/new-block-type-registration-apis-to-improve-performance-in-wordpress-6-7/
4747 */
4848function { {namespaceSnakeCase} }_{ {slugSnakeCase} }_block_init() {
49- register_block_type_from_metadata ( __DIR__ . ' /build' );
49+ wp_register_block_types_from_metadata_collection ( __DIR__ . ' /build' , __DIR__ . ' /build/blocks-manifest.php ' );
5050}
5151add_action( 'init', '{ {namespaceSnakeCase} }_{ {slugSnakeCase} }_block_init' );
You can’t perform that action at this time.
0 commit comments