,

Custom fields and post types inside the block editor – An Automattic Adventure

Earlier this week, I livestreamed to talk about Create Content Model, the open source prototype that I was lucky enough to participate in with the team from WordPress.com. If you haven’t already, I recommend watching the stream because I tell the whole story, demo the prototype, and answer a few questions. But I’ll give some additional thoughts below the video:

So how did this happen? How did I get to pretend to be an Automattician for a few weeks?

Daniel Bachhuber is the CEO running WordPress.com, though many of us know him as one of the main contributors to WP-CLI. He reached out to me about an idea that he’d had. So, earlier this year, his team participated in the Cloudfest Hackathon, building a prototype that would let you create custom post types in the block editor. Post types and custom fields- completely in Gutenberg.

Daniel wanted to see if a small team inside WordPress.com could iterate on that concept, see where it took them- and he asked me if I could pitch in. We were given time to do research, explore UX ideas, get feedback from various teams inside of Automattic (from WordPress VIP to core contributors), and ultimately determine a reasonable scope. Once we found a path forward, we were given two weeks to build a prototype. I repeat: two weeks. The goal? Building maintainable post types and custom fields inside the block editor and (this was the important part) doing it in a way that would require no extra dependencies or plugins. We generate the code, zip it up into a plugin, and give it to you to keep.

Along the way, we tested the latest Gutenberg features (like the Block Bindings API and template locking), filed issues in GitHub, and engaged in long discussions about where WordPress was headed. We wanted to ensure that our prototype could feel native and ultimately be future-proof. That meant relying only on core functionality, like post types and post meta, and user interface tools like the WordPress/components library.

We weren’t building something to put in core. Instead, we looked at the Create Block Theme plugin as a path forward (in case you couldn’t tell by the name): CBT is a developer tool that makes building block themes easier by improving your workflow and generating code that you can version control and deploy to your website. Our plugin was going to work the same way – make post types easier to build and manage inside WordPress, and generate code for you to keep.

Two weeks was not enough time to make everything we wanted, but the time constraint forced us to focus on the essentials. Like many things in WordPress, it was as much of a user interface challenge as it was a technical challenge. How do you make it intuitive? How do you make it not feel like just another confusing “thing” in the block editor? Which use cases should you prioritize? Gutenberg has brought so many disparate features into core, how do you build something that brings them all together and applies them to a very common paradigm: custom post types and custom fields?

The entire experience was a delight and extremely educational. I’ve worked on some big projects, but I’ve never worked on the inside of a huge company like Automattic.

So try out the prototype and let us know what you think. I’d love to circle back after WordPress 6.7 and clean up a few issues, and it’s always open to community contributions.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.