Skip to content

Commit b7f3416

Browse files
authored
Create block: Require WordPress 5.7 by default (#29757)
1 parent 7bf8fe3 commit b7f3416

File tree

10 files changed

+33
-40
lines changed

10 files changed

+33
-40
lines changed

packages/create-block-tutorial-template/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Enhancement
66

77
- Scaffolded block is now registered from `block.json` with the `register_block_type_from_metadata` helper ([#28883](https://github.com/WordPress/gutenberg/pull/28883)).
8+
- Scaffolded plugin requires WordPress 5.7 now ([#29757](https://github.com/WordPress/gutenberg/pull/29757).
89

910
## 1.0.0 (2021-01-21)
1011

packages/create-block-tutorial-template/templates/$slug.php.mustache

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
<?php
22
/**
3-
* Plugin Name: {{title}}
3+
* Plugin Name: {{title}}
44
{{#description}}
5-
* Description: {{description}}
5+
* Description: {{description}}
66
{{/description}}
7-
* Version: {{version}}
7+
* Requires at least: 5.7
8+
* Requires PHP: 7.0
9+
* Version: {{version}}
810
{{#author}}
9-
* Author: {{author}}
11+
* Author: {{author}}
1012
{{/author}}
1113
{{#license}}
12-
* License: {{license}}
14+
* License: {{license}}
1315
{{/license}}
1416
{{#licenseURI}}
15-
* License URI: {{{licenseURI}}}
17+
* License URI: {{{licenseURI}}}
1618
{{/licenseURI}}
17-
* Text Domain: {{textdomain}}
19+
* Text Domain: {{textdomain}}
1820
*
19-
* @package {{namespace}}
21+
* @package {{namespace}}
2022
*/
2123

2224
/**

packages/create-block-tutorial-template/templates/readme.txt.mustache

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
Contributors: {{author}}
44
{{/author}}
55
Tags: block
6-
Requires at least: 5.5.3
76
Tested up to: 5.7.0
87
Stable tag: {{version}}
9-
Requires PHP: 7.0.0
108
{{#license}}
119
License: {{license}}
1210
{{/license}}

packages/create-block-tutorial-template/templates/src/index.js.mustache

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ import save from './save';
2828
* @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block
2929
*/
3030
registerBlockType( '{{namespace}}/{{slug}}', {
31-
/**
32-
* @see https://make.wordpress.org/core/2020/11/18/block-api-version-2/
33-
*/
34-
apiVersion: {{apiVersion}},
35-
3631
/**
3732
* Used to construct a preview for the block to be shown in the block inserter.
3833
*/

packages/create-block/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
### Enhancement
1010

1111
- Block scaffolded with `esnext` template is now registered from `block.json` with the `register_block_type_from_metadata` helper ([#28883](https://github.com/WordPress/gutenberg/pull/28883)).
12+
- Scaffolded plugin requires WordPress 5.7 now ([#29757](https://github.com/WordPress/gutenberg/pull/29757)).
1213

1314
### Bug Fixes
1415

packages/create-block/lib/templates/es5/$slug.php.mustache

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
<?php
22
/**
3-
* Plugin Name: {{title}}
3+
* Plugin Name: {{title}}
44
{{#description}}
5-
* Description: {{description}}
5+
* Description: {{description}}
66
{{/description}}
7-
* Version: {{version}}
7+
* Requires at least: 5.7
8+
* Requires PHP: 7.0
9+
* Version: {{version}}
810
{{#author}}
9-
* Author: {{author}}
11+
* Author: {{author}}
1012
{{/author}}
1113
{{#license}}
12-
* License: {{license}}
14+
* License: {{license}}
1315
{{/license}}
1416
{{#licenseURI}}
15-
* License URI: {{{licenseURI}}}
17+
* License URI: {{{licenseURI}}}
1618
{{/licenseURI}}
17-
* Text Domain: {{textdomain}}
19+
* Text Domain: {{textdomain}}
1820
*
19-
* @package {{namespace}}
21+
* @package {{namespace}}
2022
*/
2123

2224
/**
@@ -33,6 +35,7 @@ function {{namespaceSnakeCase}}_{{slugSnakeCase}}_block_init() {
3335
'{{namespace}}-{{slug}}-block-editor',
3436
plugins_url( $index_js, __FILE__ ),
3537
array(
38+
'wp-block-editor',
3639
'wp-blocks',
3740
'wp-i18n',
3841
'wp-element',

packages/create-block/lib/templates/es5/readme.txt.mustache

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
Contributors: {{author}}
44
{{/author}}
55
Tags: block
6-
Requires at least: 5.6.0
76
Tested up to: 5.7.0
87
Stable tag: {{version}}
9-
Requires PHP: 7.0.0
108
{{#license}}
119
License: {{license}}
1210
{{/license}}

packages/create-block/lib/templates/esnext/$slug.php.mustache

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
<?php
22
/**
3-
* Plugin Name: {{title}}
3+
* Plugin Name: {{title}}
44
{{#description}}
5-
* Description: {{description}}
5+
* Description: {{description}}
66
{{/description}}
7-
* Version: {{version}}
7+
* Requires at least: 5.7
8+
* Requires PHP: 7.0
9+
* Version: {{version}}
810
{{#author}}
9-
* Author: {{author}}
11+
* Author: {{author}}
1012
{{/author}}
1113
{{#license}}
12-
* License: {{license}}
14+
* License: {{license}}
1315
{{/license}}
1416
{{#licenseURI}}
15-
* License URI: {{{licenseURI}}}
17+
* License URI: {{{licenseURI}}}
1618
{{/licenseURI}}
17-
* Text Domain: {{textdomain}}
19+
* Text Domain: {{textdomain}}
1820
*
19-
* @package {{namespace}}
21+
* @package {{namespace}}
2022
*/
2123

2224
/**

packages/create-block/lib/templates/esnext/readme.txt.mustache

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
Contributors: {{author}}
44
{{/author}}
55
Tags: block
6-
Requires at least: 5.6.0
76
Tested up to: 5.7.0
87
Stable tag: {{version}}
9-
Requires PHP: 7.0.0
108
{{#license}}
119
License: {{license}}
1210
{{/license}}

packages/create-block/lib/templates/esnext/src/index.js.mustache

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ import save from './save';
2626
* @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block
2727
*/
2828
registerBlockType( '{{namespace}}/{{slug}}', {
29-
/**
30-
* @see https://make.wordpress.org/core/2020/11/18/block-api-version-2/
31-
*/
32-
apiVersion: {{apiVersion}},
33-
3429
/**
3530
* @see ./edit.js
3631
*/

0 commit comments

Comments
 (0)