Tutorials
-
Using WordPress env For Docker-Based Local Development
I have been using Docker Compose for local development for years now. While I am comfortable writing or debugging a docker-compose.yml file, if I can avoid doing so, I will. Luckily, the WordPress open-source platform has a zero-config tool for Docker-based local development that is built on top of Docker Compose. If you run this…
-
Using The useEffect React Hook In WordPress
This post explains how to use the useEffect hook in WordPress.
-
Creating Reusable React Hooks For The WordPress Block Editor or Whatever
The new React documentation site is live and looks great. This section on creating custom hooks to encapsulate logic that needs to be used in multiple places in a React application is quite good. This is an important strategy to learn, and can help a lot when developing multiple blocks for a WordPress site. In…
-
How To Use WordPress Data Package To Get The Current Post Being Edited In The Post Editor
How to use the WordPress data module to get the current state of the post being editted in the WordPress block editor.
-
How To Insert Blocks In WordPress Block Editor
How to inserta block to the WordPress post editor, using JavaScript.
-
Using Plugin Machine To Build Zip Files of WordPress Plugins With Github Actions
Testing WordPress plugins, before they are released is super important. While I’m a big fan of automated testing, that doesn’t mean you don’t need manual testing. If your plugin uses modern tooling and has a PHP and/ or JavaScript build tooling, it’s not easy to get a development version of the plugin for testing. That’s…
-
What To Test First
When I talk about writing automated tests for WordPress plugins with other developers, I often hear that they’re not sure what to test first. I find the uncertainty around what to test first is a major blocker for writing tests. This post will address this concern. The other two big concerns I hear about are…
-
Building A WordPress Block Plugin To Show A Custom Field
Last night, I was looking at my phone a lot later than I should have been. I should have been stretching, but instead I was on twitter, saw this tweet, asking if there is a way to show a custom field in WordPress’ block editor: Before I shut my phone off, I replied: 🌲Generate a…
-
Using Laravel’s Container In A WordPress Plugin
A common pattern in WordPress development is to have one “Plugin” class, that implements the singleton pattern, and has an instance of each class the plugin uses sets in properties. The first time the singleton is called, all of the classes are loaded and the important hooks are set. That’s a lot of responsibilities. Modern…