A hands-on tutorial on creating a WordPress content block.
Rob Stinson created this tutorial's block.
And this uses Kent C. Dodds' format for exercises.
How to create a content block in WordPress.
This isn't a React course. It's a course on React in WordPress.
You'll learn how to develop for the WP block editor.
And you'll see typical setup of a WP block plugin.
The basics of React and modern JavaScript.
The first 12 lessons in The Beginner's Guide To React should look familiar.
Node Version Manager, Composer
Use the correct Node version:
nvm use
Install dependencies:
npm install && composer install
Watch for changes:
npm run dev
You can checkout
this plugin to your own local WordPress environment.
Or you can use the bundled environment:
npm run wp-env start
That will require Docker.
Go to http://localhost:8888 for your environment.
The username is admin
and the password is password
.
For the other wp-env
commands, see the Command Reference.
This format is taken from Kent C. Dodds.
checkout
the branch for the exercise, like exercise/1-block-json- Read
INSTRUCTIONS.md
- Find the
Files
heading inINSTRUCTIONS.md
, and edit its files - 🚧 will show where to edit
- Watch the video for the exercise solution
- Go to the next exercise, and repeat steps 1-5