← All releases

wp-content/plugins/blockwright/blockwright.php

Blockwright — beta

Scaffold a block from the admin, then read the code it wrote. Delete the plugin and the block still works.

== Description ==

Blockwright writes a block into your theme and then gets out of the way. You describe the block in a short admin form — name, attributes, whether it renders in PHP or in JavaScript — and it writes block.json, the edit component, the save component, and the registration call into a folder you choose.

The output is code you would have written. There is no runtime dependency, no abstraction layer, and no blockwright_render() anywhere in it. Uninstall the plugin and every block it generated keeps working, because nothing it generated refers back to it.

This is beta because the API for custom controls will change before 1.0. Blocks you generate today will keep working; the form you generate them from will not look the same.

== Screenshots ==

Numbered the way they ship in /assets/. Click any one to see it full width.

== Installation ==

  • Install and activate the plugin.
  • Go to Tools → Blockwright and describe the block you want.
  • Choose a destination folder inside your theme or your own plugin.
  • Read the generated files before you ship them. That is the point.

Requires a writable destination folder. It will tell you if it does not have one.

== Frequently asked questions ==

Why is it still beta?

The control API is not settled. Everything else is; the generated output has been stable since 0.7.

Does it modify files it did not create?

Only one: it appends a single register_block_type() call to your theme’s functions file, and it tells you before it does.

Can it generate dynamic blocks?

Yes. Pick PHP rendering and it writes the render callback and the template alongside the editor code.

== Changelog ==

= 0.9.4 =

  • Scaffolded blocks now write their own block.json, so they register the way core expects rather than through a shim.
  • Generated edit components use the current @wordpress/components imports.

= 0.9.0 =

  • Dynamic block generation: render callback, template file, and attribute defaults.
  • The destination picker no longer offers folders it cannot write to.

= 0.8.2 =

  • Fixed: generated block.json used the plugin's text domain instead of the destination theme's.