Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/cobianzo/gutenberg-book-reading-widget/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
BOILERPLATE for CREATING BLOCKS in the same PLUGIN
This boilerplate was created by:
- Create a plugin with
@wordpress/create-plugin - Convert the main php file into Object Oriented.
- Add
phpcs.xmlto use short array nomeclature in phpcs. It expects you to use Wordress-VIP globally. - Include
npmpackages, setuppackage.jsonand config files for linting and avoid conflicts between prettier and eslint. - Change folder structure and php file in order to have
block1andblock2in the same plugin. - @BOOK:EXTRA_JS_SCRIPTS: added an extra script that can be enqueued with the block. Like, for example, if our block is a carousel, we can include the library of the carousel in the frontned. It can be made in several ways. We do it here by modifying
webpack.config.jsand enqueueing with php.
To use it, just
npm run start
TODO
Include husky and lint-staged to run lint on staging files before commiting.
Add a third block, inner block, without the technic block.json (defining attributes in registerBlockType and enqueueing script and styles with php)