creode / wordpress-blocks
Block library and block development framework for WordPress blocks.
Installs: 685
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 4
Type:wordpress-muplugin
Requires
- dev-main
- 0.22.0
- 0.21.0
- 0.20.2
- 0.20.1
- 0.20.0
- 0.19.1
- 0.19.0
- 0.18.1
- 0.18.0
- 0.17.0
- 0.16.12
- 0.16.11
- 0.16.10
- 0.16.9
- 0.16.8
- 0.16.7
- 0.16.6
- 0.16.5
- 0.16.4
- 0.16.3
- 0.16.2
- 0.16.1
- 0.16.0
- 0.15.2
- 0.15.1
- 0.15.0
- 0.14.1
- 0.14.0
- 0.13.0
- 0.12.5
- 0.12.4
- 0.12.3
- 0.12.2
- 0.12.1
- 0.12.0
- 0.11.0
- 0.10.0
- 0.9.0
- 0.8.0
- 0.7.0
- 0.6.0
- 0.5.0
- 0.4.0
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.1
- 0.2.0
- 0.1.0
- 0.0.5
- 0.0.4
- 0.0.3
- 0.0.2
- 0.0.1
- 0.0.0
- dev-feature/ci
- dev-hotfix/function_return_value
- dev-hotfix/wp-cli-options-warning
- dev-feature/supports
- dev-feature/add_make_block_command
This package is auto-updated.
Last update: 2024-12-24 12:36:51 UTC
README
This is a WordPress plugin which contains a few blocks to assist in starting out a new project. The blocks are built using the WordPress ACF and the block editor. This module also contains infrastructure to assist in the creation of template based blocks.
Installation
Installation of this can be done using composer: composer require creode/wordpress-blocks
Usage
This plugin once installed will be added to the mu-plugin folder so it is ready for it to be used in your project.
Creating new blocks
In order to create new blocks, you can add a new class to your theme or plugin and extend the Creode_Blocks\Block
class.
If you are utilising WP_CLI for your project, you can use the following command to create a new block class:
wp make-block "Creode Footer" --theme="creode"
This will create a newly configured block class and template file within your theme, inside the blocks
directory. The theme argument is optional and will default to the current theme.
It will also output a couple of lines that can be copy and pasted into your functions.php
file to include the block class and get started quickly.
Creating child blocks
Child blocks are defined within your block class inside the child_blocks()
function. You can just need to return an array of new Creode_Blocks\Child_Block
instances from it.
Roadmap
- Continue to expand the base offering of block classes
- Implement a command to create new blocks in your theme using
WP_CLI