Custom post types, authors, and custom roles

When you create a custom post type in WordPress, you can set it to ‘support’ a number of things: a featured image, trackbacks, revisions… and author. You might want to use it in the way author is used for core posts, literally the credited author of a post. Or maybe you could use it to give a bit more granularity to user permissions. The ‘owner’ of a post, if you will. Great!

Well, that’s what I wanted to do. Turns out it’s a little more complicated…

Read more »

When a post is first published, but not when it’s re-published

I’ve just been looking into some WordPress code that needs to run only when a post is first published.

WordPress provides a number of hooks for post status transitions. You’d think the one to use would be post_publish. However, testing shows that this also fires when a post is updated. Also, consider the scenario where an editor sets a post back to draft, then re-publishes. Do you also want the code to run then?

Read more »

Hide recurring events in admin for The Events Calendar

I’m just getting going with Modern Tribe’s The Events Calendar plugin, and so far it’s very impressive.

As with any plugin, however good, it’s got its idiosyncracies and annoyances. I’ve just been looking into how to hide recurring instances of events in the admin list. It seems the plugin used to include admin list filter options, but they’ve recently been taken out of this plugin and shifted to their Advanced Post Manager plugin.

Now, I use Codepress’ Admin Columns, and I don’t have time for weighing these two up right now. Generally I’m very happy with what I’ve got. But I think loading both plugins at once might lead to messiness. Maybe I can just whip up a little bit of code for now to add this simple feature?

Read more »

How Buildings Learn


Soon after I moved to London in 1999 to work in the web industry, my friend Jim urged me to read this book, How Buildings Learn by Stewart Brand.

Brand’s an interesting character. After some time in the army, in the ’60s he studied design, and became involved with the Merry Pranksters’ infamous ‘Acid Tests’. During the ’70s he produced the Whole Earth Catalog, the counter-culture’s DIY Bible, and in the ’80s he was instrumental in the seminal WELL online community’s development.

How Buildings Learn is subtitled ‘What happens after they’re built’. It’s basically a critique of architecture as an imposition, and a championing of the needs of the occupants of buildings. Brand points out that most architecture competitions are judged on photographs of the buildings on the day of completion. But visit the stunning, award-winning structure a year later, and it’s not unusual to find leaking roofs and unhappy people. Visit it decades later, and it may be severely dysfunctional, hampered forever by the image- rather than time-oriented stamp of the architect’s ego.

Brand champions design that accommodates change, making space for people to change things through use. Adaptation. Responsiveness, you might say.

Read more »

Moving to Linux

I recently moved to Linux on my desktop, after many years of being Windows-by-default. I was never fervently for or against Windows, but eventually the advantages for web development of working on the same OS as my servers, not to mention a much more potent OS in terms of local development, were too great to ignore. In this post I want to share a few practical tips, which will hopefully be of use to someone else making the transition.

Read more »

Developer’s Custom Fields 2.0 – a rewrite

Together with Adrian Toll, I’m starting to plan a new, mostly rewritten version of the plugin Developer’s Custom Fields.

Despite the obvious power and sophistication of plugins such as Advanced Custom Fields, we both prefer the lighter, more developer-friendly style of our own plugin. And while the proposed metadata UI for core seemed promising for a while, it seems to have stalled for now, or at the very least slowed down considerably. So, we’ve decided to revamp to give this plugin a healthy lease of life until a rival solution does a better job for us.

Read more »

Letting go of Force Strong Passwords

For a while now, I’ve been using the Wordfence plugin to add extra security to my WordPress sites. Since this plugin includes (among other things) the ability to force users to choose strong passwords, I’ve stopped using my own plugin, Force Strong Passwords.

Because of this, I’ve decided to transfer it to someone else. Jason Cosper has kindly stepped up. Jason’s a senior engineer at WP Engine, who I gather use the plugin on their network. With this vested interest in the plugin, I trust it’s in good hands.

Blog archive