Skip to content

Commit

Permalink
Create block: Require WordPress 5.7 by default (#29757)
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Mar 11, 2021
1 parent 7bf8fe3 commit b7f3416
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 40 deletions.
1 change: 1 addition & 0 deletions packages/create-block-tutorial-template/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Enhancement

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

## 1.0.0 (2021-01-21)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
<?php
/**
* Plugin Name: {{title}}
* Plugin Name: {{title}}
{{#description}}
* Description: {{description}}
* Description: {{description}}
{{/description}}
* Version: {{version}}
* Requires at least: 5.7
* Requires PHP: 7.0
* Version: {{version}}
{{#author}}
* Author: {{author}}
* Author: {{author}}
{{/author}}
{{#license}}
* License: {{license}}
* License: {{license}}
{{/license}}
{{#licenseURI}}
* License URI: {{{licenseURI}}}
* License URI: {{{licenseURI}}}
{{/licenseURI}}
* Text Domain: {{textdomain}}
* Text Domain: {{textdomain}}
*
* @package {{namespace}}
* @package {{namespace}}
*/

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
Contributors: {{author}}
{{/author}}
Tags: block
Requires at least: 5.5.3
Tested up to: 5.7.0
Stable tag: {{version}}
Requires PHP: 7.0.0
{{#license}}
License: {{license}}
{{/license}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ import save from './save';
* @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block
*/
registerBlockType( '{{namespace}}/{{slug}}', {
/**
* @see https://make.wordpress.org/core/2020/11/18/block-api-version-2/
*/
apiVersion: {{apiVersion}},

/**
* Used to construct a preview for the block to be shown in the block inserter.
*/
Expand Down
1 change: 1 addition & 0 deletions packages/create-block/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Enhancement

- 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)).
- Scaffolded plugin requires WordPress 5.7 now ([#29757](https://github.com/WordPress/gutenberg/pull/29757)).

### Bug Fixes

Expand Down
19 changes: 11 additions & 8 deletions packages/create-block/lib/templates/es5/$slug.php.mustache
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
<?php
/**
* Plugin Name: {{title}}
* Plugin Name: {{title}}
{{#description}}
* Description: {{description}}
* Description: {{description}}
{{/description}}
* Version: {{version}}
* Requires at least: 5.7
* Requires PHP: 7.0
* Version: {{version}}
{{#author}}
* Author: {{author}}
* Author: {{author}}
{{/author}}
{{#license}}
* License: {{license}}
* License: {{license}}
{{/license}}
{{#licenseURI}}
* License URI: {{{licenseURI}}}
* License URI: {{{licenseURI}}}
{{/licenseURI}}
* Text Domain: {{textdomain}}
* Text Domain: {{textdomain}}
*
* @package {{namespace}}
* @package {{namespace}}
*/

/**
Expand All @@ -33,6 +35,7 @@ function {{namespaceSnakeCase}}_{{slugSnakeCase}}_block_init() {
'{{namespace}}-{{slug}}-block-editor',
plugins_url( $index_js, __FILE__ ),
array(
'wp-block-editor',
'wp-blocks',
'wp-i18n',
'wp-element',
Expand Down
2 changes: 0 additions & 2 deletions packages/create-block/lib/templates/es5/readme.txt.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
Contributors: {{author}}
{{/author}}
Tags: block
Requires at least: 5.6.0
Tested up to: 5.7.0
Stable tag: {{version}}
Requires PHP: 7.0.0
{{#license}}
License: {{license}}
{{/license}}
Expand Down
18 changes: 10 additions & 8 deletions packages/create-block/lib/templates/esnext/$slug.php.mustache
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
<?php
/**
* Plugin Name: {{title}}
* Plugin Name: {{title}}
{{#description}}
* Description: {{description}}
* Description: {{description}}
{{/description}}
* Version: {{version}}
* Requires at least: 5.7
* Requires PHP: 7.0
* Version: {{version}}
{{#author}}
* Author: {{author}}
* Author: {{author}}
{{/author}}
{{#license}}
* License: {{license}}
* License: {{license}}
{{/license}}
{{#licenseURI}}
* License URI: {{{licenseURI}}}
* License URI: {{{licenseURI}}}
{{/licenseURI}}
* Text Domain: {{textdomain}}
* Text Domain: {{textdomain}}
*
* @package {{namespace}}
* @package {{namespace}}
*/

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
Contributors: {{author}}
{{/author}}
Tags: block
Requires at least: 5.6.0
Tested up to: 5.7.0
Stable tag: {{version}}
Requires PHP: 7.0.0
{{#license}}
License: {{license}}
{{/license}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ import save from './save';
* @see https://developer.wordpress.org/block-editor/developers/block-api/#registering-a-block
*/
registerBlockType( '{{namespace}}/{{slug}}', {
/**
* @see https://make.wordpress.org/core/2020/11/18/block-api-version-2/
*/
apiVersion: {{apiVersion}},

/**
* @see ./edit.js
*/
Expand Down

0 comments on commit b7f3416

Please sign in to comment.