create-wordpress-block
create-wordpress-block copied to clipboard
Feature: Add template which would support WordPress single block directory
There is this question from @bph:
If I wanted to use it for a single block plugin, and I see a great use case for it, but it would need boilerplate
pluginname.php
. I created the file added the header information and move theindex.php
information to that file. That was easy, so easy, that it might go into the script?
I think we should either add a template that addresses the needs of the single block directory project. An alternative approach would be to add more optional prompts that cover all metadata required by the WordPress plugin.
For the plugin directory, we also need the readme.txt file that holds the information displayed in the WP directory for "Tags" "Installation" "Description" "Screenshot" "Version" etc..
I took the simplest approach possible and added plugin metadata to the PHP file in both templates: es5
and esnext
. Related code change:
https://github.com/gziolo/create-wordpress-block/commit/0d3145df6e75c236e9c63ac9dcfc2990ca291b7d
@bph - do you have a good example of the readme.txt
file I could use?
You can test the next version by running inside wp-content/plugins
:
npm init wordpress-block@next
npm init wordpress-block@next --template es5
I will check out the new version this week... Here are two examples of readme text from my favorite plugins.
- @jjj Post Type Switcher
- @ocean90 Public Post Preview
See also:
"Readme files: To make your entry in the plugin browser most useful, each plugin should have a readme file named readme.txt that adheres to the WordPress plugin readme file standard. You can put your readme file through the readme validator to check it. " • https://wordpress.org/plugins/readme.txt • https://wordpress.org/plugins/developers/readme-validator/