On standardized post formats

A few months ago, when WordPress 3.1 and the new Post Formats feature began to get some coverage in the community, there was a minor backlash over how the core team interpreted and decided to implement the feature. I spent most of the day on Twitter doing damage control.

By the day’s end, I was able to tell a number of detractors that I would spend some time taking my thoughts — communicated in pieces in 140 or less characters throughout the day — into a blog post. I never did that.

For a while, I figured it would no longer be necessary. But as WordPress 3.1 is edging ever closer to release, I’m realizing that failing to communicate the true purpose of this feature is going to be a heavy responsibility on the core team, and on myself for promising an explanation.

I just posted a comment on a blog post about this. I had to tell the author that he didn’t quite understand the point of the feature — and that I felt responsible.

So, here’s our take on what post formats are, what they are not, and why there are what they are.

Originally, the entire feature was envisioned as a single Codex page.

There was no code. It was simply going to outline a standard: a name for a custom taxonomy, and a standardized set of formats. Any theme wishing to leverage post formats could then perform the initial taxonomy registration. A blogger could switch between themes that supported post formats, and things would be seamless. Sounds simple, right?

Not so much. Standardization here would be exceedingly difficult. How a theme implemented the code aside, there was at least one issue that would be a dealbreaker: whether a requested term name and slug would be available for a particular user. Because terms share the same namespace across taxonomies, a gallery tag might mess up a gallery post format, causing for example gallery-2. This would not work; it defeats the purpose of creating a standard. We decided that we would need to namespace terms for optimal portability: post-format-gallery is how it gets stored under the hood, for example.

So, instead of just implementing a Codex page, we went out to write some code — but we kept it as minimal as possible. The actual implementation of post formats is pretty dry. It’s a custom taxonomy, with a custom meta box — two things any theme or plugin could register and leverage on their own. It uses APIs which have largely existed since WordPress 2.5. For all the new cool things we add each version, this feature’s purpose had nothing to do with the code. Literally nothing was added anywhere that a theme or plugin couldn’t already do, for some time at that.

And that brings us back to the point of the feature.

With term names and such, we went through great lengths to ensure formats were as portable as possible. The idea behind the feature is this standardization and portability for a segment of bloggers. Many designers of themes used for microblogging wanted this ability to offer structured, well-defined content, beyond what could be done with categories and tags. It’s designed so when you switch to a different theme — a specific kind of theme, at that — your content doesn’t lose its most fundamental context.

The feature isn’t for everyone.

I don’t expect every theme out there to leverage them. They’re frankly not always useful — it fulfills a specific role. A number of themes and theme companies will benefit greatly from this. Custom implementations will not, and that’s the idea.

Many have suggested that “the WordPress way” would be to establish a standard, but then still allow plugins and themes to hook in and add their own post formats. Ultimately, this feature is an exception of the rule. It’s not like we decided we liked the idea of post formats and then later came across the idea to force them to be standardized. No, the idea we started with — before we had a name for them, even — was the standardization itself. The only new thing this feature brings to the table is the portability enabled through standardization. Without that, the feature is useless.

If you want a custom post format, then chances are you shouldn’t be using post formats.

Here’s the great thing: Nothing is lost. If you want to do a custom implementation, then just roll the feature yourself, as a custom taxonomy. That might sound daunting, but it’s not at all. It’s the same thing you would have done in 3.0 in any custom implementation: a few dozen lines of code to register a custom taxonomy and a meta box. Then you can use body/post classes and template tags in your theme and style the posts based on that.

So, if you’re writing a microblogging theme and wish to leverage post formats, by all means, please do. If you want a challenge, roll your own meta box, add icons for each format, and do whatever you’d like to fulfill the niche. There’s no requirement to actually support our UI for it; that’s just to get things going. I really want to encourage some creativity in this space.

If you’re doing a custom implementation or a special theme and want something like post formats, then think about how you would have done that in WordPress 3.0: You would have registered a taxonomy. Yeah, it really is that simple.

If you have a comment or gripe, please comment.

I’ll do what I can to address it. I’m sure there are stones left unturned, and I want there to be understanding, even if we won’t all be in agreement.


Some further thoughts and suggested reading: My colleague Otto Wood has previously written on this topic, in “Post types and formats and taxonomies, oh my!”, which does a great job summarizing the user’s point of view.

I’ve also been asked quite a few times whether post formats or custom post types makes sense for project X. My answer is generally pretty blunt: If you’re not sure which you should use, then chances are you’re horribly skewing the purpose of one of them. Otto’s post goes into this, and you may also wish to read Mark Jaquith’s post on Post Formats versus Custom Post Types.

Are there flaws? Yes. There are a few confusing factors here. One, as Mark suggests, a ‘custom post type’ is a horrible name for what it really is. Ironically, the best name for ‘post formats’ (trust me, we pulled out our thesauruses for this one) would have been ‘post types.’ Then there’s the confusion where some have used the term ‘custom post formats’ even though they’re not talking about custom ones at all — probably because of confusion around the similar-sounding ‘custom post types’ term.

Finally, on the subject of Twenty Ten supporting post formats: From a theme level, it makes perfect sense. Twenty Ten already supported special styling for asides and galleries, which (along with the P2 theme) was a natural precursor to post formats. Looking at it in the context of a default WordPress installation, you now have categories, tags, and post formats. It can definitely be a bit much. Hopefully, users will discover the Help tab (something we should make more prominent for new users). I also think it is further mitigated by one of my favorite enhancements to 3.1: hiding most of the meta boxes on the Add New Post screen by default.

New Plugin: Filtered HTML for Editors

I just released a new plugin, Filtered HTML for Editors.

This is in response to a published report suggesting there is a vulnerability in WordPress 3.0.4. The report is invalid, but I’m offering this plugin for sites that do not trust users given the Editor role.

For more information, please read my blog post on the WordPress Development Updates blog, and read the plugin’s description and FAQ.

Better admin menu handling for post types in WordPress 3.1

There are about a dozen major features lined up for WordPress 3.1. My main tasks for 3.1 centered around improvements to custom post types. Since we’re in late beta stage, I wanted to offer a summary of all the cool enhancements soon coming to a site near you.

I started with a post on our development blog what I wanted to see, and asked others to chime in and share their “pet bugs, peeves, and workarounds.” The end result cemented what needed to get done for the cycle. There were many small incremental improvements, but a few stood out, which I’ll be covering in a series of posts this week.

Hiding the admin menu

In 3.0, when you register a post type with show_ui, you’ll end up with a top-level admin menu page, with submenu pages for edit, add, and any taxonomies.

Sometimes though, this isn’t ideal. Perhaps you’re using the user interface as a read-only display of logged information, or your post type works great as a specific subset of another admin menu, like slideshows under Media. Continue reading Better admin menu handling for post types in WordPress 3.1

Dream Job

Monday was my first day at my dream job.

What I hope it means is that I’ll be able to devote more of my time to building up the infrastructure behind the WordPress community, as it extends beyond the software: things like the wordpress.org site, handbooks, and the API reference, for example. This is nothing short of a dream opportunity for me, to be contributing to open source and working on WordPress all day.

I’m working at Matt Mullenweg’s investment and research firm, Audrey Capital.

There isn’t much publicly available about Audrey just yet as everything is just getting off the ground. (You can see some of Matt’s investments on his blog and the placeholder site.) Matt even joked that a downside to working there is that it will be tough to explain what I do, or even where I work.

Beyond core development, a lot of my work for now will be behind the scenes on wordpress.org — the site and its infrastructure — a space where there are many visionary ideas to implement. Far too many projects have been left sitting on the back burner. I’ll be working on WordPress, and probably BuddyPress, bbPress, and GlotPress too — whatever comes across my plate, really. Of course, I’ll also be working on other random projects, at both Matt’s behest and my initiative.

The day I accepted an offer to work at Audrey was coincidentally the day that it was jokingly suggested on Twitter there should be a betting pool for the date I become an Automattic employee. Automattic is an amazing place to work, without question. But I want my role to be about the community, and I’m not sure getting my fix there working on other projects would truly allow for that. To me, working there would be about the people. But I’ll see my many friends there at WordCamps and meetups, regardless of where I work.

I’ve always felt a certain debt to the community. It’s why I got to where I am today, and I feel an important responsibility is to communicate with developers and users at large. The open source project is where I was given the opportunity to prove myself. It was only in January that I realized that I might eventually be able to make a living as a freelance consultant. When I was named a committer in February, my outlook changed quite a bit. My, how far we’ve come.

The project is where I feel I can continue to make the most impact. While freelancing, I’ve had the freedom to choose what I want to work on, and, above all, continue my active participation in the open source project.

But over the last few months, I found that even the most exciting project could not motivate me the way WordPress core and the community do. And eventually, my momentum on core would have slowed as I took on more projects. So when Matt asked me if I wanted to join Audrey, it was an offer I could never refuse, coming from someone to whom you could never say no.

It’s my dream job, complete with an awesome employer and so far one awesome coworker. My title, like Otto’s, is Tech Ninja.