create-wordpress-block icon indicating copy to clipboard operation
create-wordpress-block copied to clipboard

Feature: Add template which would support WordPress single block directory

Open gziolo opened this issue 5 years ago • 4 comments

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 the index.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.

gziolo avatar Dec 19 '19 12:12 gziolo

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..

bph avatar Dec 19 '19 13:12 bph

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

gziolo avatar Jan 08 '20 19:01 gziolo

I will check out the new version this week... Here are two examples of readme text from my favorite plugins.

bph avatar Jan 09 '20 15:01 bph

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/

ntwb avatar Jan 10 '20 06:01 ntwb