@wordpress/create-block-tutorial-template 2.4.1-next.d6164808d3.0 → 2.5.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,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.5.0 (2022-08-24)
6
+
7
+ ### Enhancement
8
+
9
+ - Add support to the `dynamic` variant ([#41289](https://github.com/WordPress/gutenberg/pull/41289), [#43481](https://github.com/WordPress/gutenberg/pull/43481)).
10
+
5
11
  ## 2.3.0 (2022-06-01)
6
12
 
7
13
  ### Enhancement
@@ -44,6 +44,7 @@ registerBlockType( metadata.name, {
44
44
  */
45
45
  edit: Edit,
46
46
  {{#isStaticVariant}}
47
+
47
48
  /**
48
49
  * @see ./save.js
49
50
  */
@@ -1,5 +1,5 @@
1
1
  {{#isDynamicVariant}}
2
2
  <p <?php echo get_block_wrapper_attributes(); ?>>
3
- <?php echo esc_html( $atts['message']) ?>
3
+ <?php echo esc_html( $attributes['message'] ); ?>
4
4
  </p>
5
5
  {{/isDynamicVariant}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/create-block-tutorial-template",
3
- "version": "2.4.1-next.d6164808d3.0",
3
+ "version": "2.5.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": "ba8a396d2f418e53a6c4c50575582f3f3eb11ff7"
24
+ "gitHead": "171b87c7465b93e685e081c5f57f153507363c95"
25
25
  }
@@ -37,25 +37,24 @@
37
37
  *
38
38
  * @see https://developer.wordpress.org/reference/functions/register_block_type/
39
39
  */
40
- {{#isStaticVariant}}
41
40
  function {{namespaceSnakeCase}}_{{slugSnakeCase}}_block_init() {
41
+ {{#isStaticVariant}}
42
42
  register_block_type( __DIR__ . '/build' );
43
- }
44
- add_action( 'init', '{{namespaceSnakeCase}}_{{slugSnakeCase}}_block_init' );
45
- {{/isStaticVariant}}
46
- {{#isDynamicVariant}}
47
- function {{namespaceSnakeCase}}_{{slugSnakeCase}}_block_init() {
43
+ {{/isStaticVariant}}
44
+ {{#isDynamicVariant}}
48
45
  register_block_type(
49
46
  __DIR__ . '/build',
50
47
  array(
51
48
  'render_callback' => '{{namespaceSnakeCase}}_{{slugSnakeCase}}_render_callback',
52
49
  )
53
50
  );
51
+ {{/isDynamicVariant}}
54
52
  }
55
53
  add_action( 'init', '{{namespaceSnakeCase}}_{{slugSnakeCase}}_block_init' );
54
+ {{#isDynamicVariant}}
56
55
 
57
56
  /**
58
- * Render callback function
57
+ * Render callback function.
59
58
  *
60
59
  * @param array $attributes The block attributes.
61
60
  * @param string $content The block content.
@@ -63,7 +62,7 @@ add_action( 'init', '{{namespaceSnakeCase}}_{{slugSnakeCase}}_block_init' );
63
62
  *
64
63
  * @return string The rendered output.
65
64
  */
66
- function {{namespaceSnakeCase}}_{{slugSnakeCase}}_render_callback( $atts, $content, $block) {
65
+ function {{namespaceSnakeCase}}_{{slugSnakeCase}}_render_callback( $atts, $content, $block ) {
67
66
  ob_start();
68
67
  require plugin_dir_path( __FILE__ ) . 'build/template.php';
69
68
  return ob_get_clean();