Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create block: Require WordPress 5.7 by default and source it from the main plugin file #29757

Merged
merged 1 commit into from
Mar 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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