@wordpress/create-block 4.81.0 → 4.82.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,8 +39,8 @@ if ( ! defined( 'ABSPATH' ) ) {
39
39
  }
40
40
  {{#wpScripts}}
41
41
  /**
42
- * Registers the block using a `blocks-manifest.php` file, which improves the performance of block type registration.
43
- * Behind the scenes, it also registers all assets so they can be enqueued
42
+ * Registers the block(s) metadata from the `blocks-manifest.php` and registers the block type(s)
43
+ * based on the registered block metadata. Behind the scenes, it registers also all assets so they can be enqueued
44
44
  * through the block editor in the corresponding context.
45
45
  *
46
46
  * @see https://make.wordpress.org/core/2025/03/13/more-efficient-block-type-registration-in-6-8/
@@ -58,36 +58,7 @@ if ( ! defined( 'ABSPATH' ) ) {
58
58
  {{/wpScripts}}
59
59
  function {{namespaceSnakeCase}}_{{slugSnakeCase}}_block_init() {
60
60
  {{#wpScripts}}
61
- /**
62
- * Registers the block(s) metadata from the `blocks-manifest.php` and registers the block type(s)
63
- * based on the registered block metadata.
64
- * Added in WordPress 6.8 to simplify the block metadata registration process added in WordPress 6.7.
65
- *
66
- * @see https://make.wordpress.org/core/2025/03/13/more-efficient-block-type-registration-in-6-8/
67
- */
68
- if ( function_exists( 'wp_register_block_types_from_metadata_collection' ) ) {
69
- wp_register_block_types_from_metadata_collection( __DIR__ . '/build', __DIR__ . '/build/blocks-manifest.php' );
70
- return;
71
- }
72
-
73
- /**
74
- * Registers the block(s) metadata from the `blocks-manifest.php` file.
75
- * Added to WordPress 6.7 to improve the performance of block type registration.
76
- *
77
- * @see https://make.wordpress.org/core/2024/10/17/new-block-type-registration-apis-to-improve-performance-in-wordpress-6-7/
78
- */
79
- if ( function_exists( 'wp_register_block_metadata_collection' ) ) {
80
- wp_register_block_metadata_collection( __DIR__ . '/build', __DIR__ . '/build/blocks-manifest.php' );
81
- }
82
- /**
83
- * Registers the block type(s) in the `blocks-manifest.php` file.
84
- *
85
- * @see https://developer.wordpress.org/reference/functions/register_block_type/
86
- */
87
- $manifest_data = require __DIR__ . '/build/blocks-manifest.php';
88
- foreach ( array_keys( $manifest_data ) as $block_type ) {
89
- register_block_type( __DIR__ . "/build/{$block_type}" );
90
- }
61
+ wp_register_block_types_from_metadata_collection( __DIR__ . '/build', __DIR__ . '/build/blocks-manifest.php' );
91
62
  {{/wpScripts}}
92
63
  {{^wpScripts}}
93
64
  register_block_type( __DIR__ . '/build/{{slug}}' );
package/lib/templates.js CHANGED
@@ -285,9 +285,9 @@ const getDefaultValues = ( projectTemplate, variant ) => {
285
285
  license: 'GPL-2.0-or-later',
286
286
  licenseURI: 'https://www.gnu.org/licenses/gpl-2.0.html',
287
287
  version: '0.1.0',
288
- requiresAtLeast: '6.7',
288
+ requiresAtLeast: '6.8',
289
289
  requiresPHP: '7.4',
290
- testedUpTo: '6.7',
290
+ testedUpTo: '6.8',
291
291
  wpScripts: true,
292
292
  customScripts: {},
293
293
  wpEnv: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/create-block",
3
- "version": "4.81.0",
3
+ "version": "4.82.0",
4
4
  "description": "Generates PHP, JS and CSS code for registering a block for a WordPress plugin.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@inquirer/prompts": "^7.2.0",
41
- "@wordpress/lazy-import": "^2.38.0",
41
+ "@wordpress/lazy-import": "^2.39.0",
42
42
  "chalk": "^4.0.0",
43
43
  "change-case": "^4.1.2",
44
44
  "check-node-version": "^4.1.0",
@@ -54,5 +54,5 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  },
57
- "gitHead": "50c4c0f51e4797c217946ce42adfaa5eb026f33f"
57
+ "gitHead": "eee1cfb1472f11183e40fb77465a5f13145df7ad"
58
58
  }