Gutenberg is an ambitious project that aims to completely overhaul the experience of writing content in WordPress.
One of the problems you’ll soon run into when building a block for Gutenberg is that as a block becomes more complex, storing its complete output statically becomes undesirable. If a block contains several fields or its output contains HTML markup, you don’t want to find yourself in a situation where this output needs to be changed at some point in the future and you need to retrospectively apply changes to stored block output in every post.
Gutenberg supports dynamic block rendering so that you can perform more complex output rendering on the fly, without having to store the complete output when the block is saved. This is the same method that shortcodes in WordPress use and allows you to move away from static block output. If you’re building a block for Gutenberg that uses anything more than very simple output, you should consider using dynamic rendering.
You can take this one step further and build a dynamic block for Gutenberg which uses a theme template part for its output. This way, the theme on your site really is in control of its output, regardless of where the block is registered.
Continue reading “Rendering Dynamic Gutenberg Blocks in Theme Template Parts”
Ever wondered about situations where WordPress sends an email? I documented them all & how to filter or disable them.
The document lists every situation where WordPress sends an email, along with how to filter or disable each email. It’s accurate as of WordPress 4.9, and will soon include some upcoming changes in WordPress 5.0.
Recently I’ve been working to reduce the Travis CI build times of not only WordPress core, but also the WordPress plugins and projects that I maintain.
I’m going to use this post to document patterns and tips that you can use to speed up your build times. Comments welcome!
Continue reading “Reducing Travis CI Build Times for WordPress Projects”
For us, there’s so much more value to be gained from building on each other’s work and knowledge than trying to hold on to a short-term technological advantage.
ustwo: An Open Source Example of a React-Powered WordPress Site
Last updated for WordPress 4.9.
Did you know that the
index.php file in a WordPress theme can be empty? There’s no need for it to contain anything at all, as long as you have the following template files in place:
Continue reading “ASCII WordPress Template Hierarchy”
Here’s a list of the developer-oriented plugins for WordPress that I use on a regular basis. (Alternative title: 10 WordPress Plugins You Can’t Live Without. You’ll Never Believe What Number 4 Does!)
Continue reading “WordPress Developer Plugins”
As a fun data visualisation experiment – and as a way to practice my new found interest in Node.js – I decided to plot on a map of the world all the people who contributed to the recent release of WordPress 3.6. The map can be seen further down, but first a brief description of how I went about it.
I decided to generate a GeoJSON file of the contributor’s locations so it can be displayed wherever and however the open GeoJSON format is supported, not least on GitHub which recently added support for automatic rendering of GeoJSON files.
Continue reading “WordPress Contributors on a World Map”
I thought I’d run some stats on WordPress contributors over the years. The only contributor stats I have are the ones published in each release announcement on wordpress.org, so I’ve put these stats together myself from those lists.
Unfortunately the release announcements have only listed the contributors since version 2.9 (June 2009). If anyone wants to get me the list of contributors for earlier versions I’ll happily update this post. It’d be interesting to see the numbers over the years.
Continue reading “A History of WordPress Contributors”
Latest version: 1.0– Released 15/06/2012:
This plugin allows you to display Pocket ‘Read It Later’ links next to each post on your blog. You can see an example on the Pocket blog. You can automatically insert the links adjacent to your blog posts or you can use the template tag to insert the links wherever you like.
Continue reading “WordPress Plugin: Pocket Read It Later Links”
If your plugin or theme uses custom post meta fields then you may want to store revisions to these fields when a post revision is saved. It’s easy to do.
For each of our meta fields, we’ll need to do three things:
- Store a revision of the meta field when a post is saved
- Revert to the correct revision of the meta field when a post is reverted
- Optionally, display the meta field on the revisions screen
Continue reading “Saving Post Meta Field Revisions in WordPress”