@wordpress/create-block-tutorial-template 2.8.0 → 2.10.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.10.0 (2022-11-16)
6
+
7
+ ## 2.9.0 (2022-11-02)
8
+
9
+ ### Enhancement
10
+
11
+ - Update templates to use the `render` field in `block.json` introduced in WordPress 6.1 ([#44185](https://github.com/WordPress/gutenberg/pull/44185)).
12
+
5
13
  ## 2.8.0 (2022-10-19)
6
14
 
7
15
  ## 2.7.0 (2022-10-05)
package/index.js CHANGED
@@ -30,6 +30,7 @@ module.exports = {
30
30
  type: 'string',
31
31
  },
32
32
  },
33
+ render: 'file:./render.php',
33
34
  },
34
35
  },
35
36
  pluginTemplatesPath: join( __dirname, 'plugin-templates' ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/create-block-tutorial-template",
3
- "version": "2.8.0",
3
+ "version": "2.10.0",
4
4
  "description": "Template for @wordpress/create-block used in the official WordPress tutorial.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -21,5 +21,5 @@
21
21
  "publishConfig": {
22
22
  "access": "public"
23
23
  },
24
- "gitHead": "a2ff0e6471c88436dad0287beb88d1729aa6f5dd"
24
+ "gitHead": "7ac04f446242452d3cb24372f9ca58f0cae97715"
25
25
  }
@@ -8,7 +8,7 @@
8
8
  * Description: {{description}}
9
9
  {{/description}}
10
10
  * Version: {{version}}
11
- * Requires at least: 5.9
11
+ * Requires at least: 6.1
12
12
  * Requires PHP: 7.0
13
13
  {{#author}}
14
14
  * Author: {{author}}
@@ -38,33 +38,6 @@
38
38
  * @see https://developer.wordpress.org/reference/functions/register_block_type/
39
39
  */
40
40
  function {{namespaceSnakeCase}}_{{slugSnakeCase}}_block_init() {
41
- {{#isStaticVariant}}
42
41
  register_block_type( __DIR__ . '/build' );
43
- {{/isStaticVariant}}
44
- {{#isDynamicVariant}}
45
- register_block_type(
46
- __DIR__ . '/build',
47
- array(
48
- 'render_callback' => '{{namespaceSnakeCase}}_{{slugSnakeCase}}_render_callback',
49
- )
50
- );
51
- {{/isDynamicVariant}}
52
42
  }
53
43
  add_action( 'init', '{{namespaceSnakeCase}}_{{slugSnakeCase}}_block_init' );
54
- {{#isDynamicVariant}}
55
-
56
- /**
57
- * Render callback function.
58
- *
59
- * @param array $attributes The block attributes.
60
- * @param string $content The block content.
61
- * @param WP_Block $block Block instance.
62
- *
63
- * @return string The rendered output.
64
- */
65
- function {{namespaceSnakeCase}}_{{slugSnakeCase}}_render_callback( $atts, $content, $block ) {
66
- ob_start();
67
- require plugin_dir_path( __FILE__ ) . 'build/template.php';
68
- return ob_get_clean();
69
- }
70
- {{/isDynamicVariant}}
@@ -3,7 +3,7 @@
3
3
  Contributors: {{author}}
4
4
  {{/author}}
5
5
  Tags: block
6
- Tested up to: 6.0
6
+ Tested up to: 6.1
7
7
  Stable tag: {{version}}
8
8
  {{#license}}
9
9
  License: {{license}}