Blog

Disabling WordPress plugin deactivation and theme changing

Someone asked in a comment here recently whether a WordPress plugin I’d posted could be adapted to work as theme code. The reasoning was that a client might deactivate a plugin, breaking some of the site’s functionality.

Careless clients clicking around in the admin interface can be a concern for a responsible developer. Of course, the primary way of limiting this kind of risk is to assign clients to appropriate roles. If the pre-defined roles don’t quite fit, Justin Tadlock’s excellent Members plugin can help you get it right.

But say you have a client to whom you want to give plugin activation / deactivation capabilities (so they can add new plugins themselves), but the site you’ve built includes certain plugins that really shouldn’t be deactivated. What then?

Read more »

Intercept WordPress 404s

So, I’ve got a WordPress site with a bunch of custom post types. On the archive pages for those posts, I have a taxonomy drop-down for a custom taxonomy called “theme” (I know, a slightly confusing label to use in WordPress, but that’s what it has to be). The idea is that you select the theme and the archive listing is filtered accordingly.

Now, for creating the drop-down I use get_terms. This has a hide_empty argument, which will omit terms that aren’t being used. The problem is, my “theme” taxonomy applies to all custom post types. So if a term is applied to any post anywhere, it is included, even if it’s not used at all for the post type being viewed, it appears in the drop-down. When you select it, you get a 404, because the request returns no posts.

How can I stay on the archive template and return a polite “There are no posts here for this theme”?

Read more »

SLT Custom Fields 0.4 (beta)

There’s a new version of my custom fields WordPress plugin. Development got slowed to a halt and I’ve not included everything I wanted to in this release, but I’ve put it out because it contains a fix for a bug someone kindly found.

There’s a bunch of new features, which need thorough testing to iron out any further bugs. Check out the changelog in the readme.txt for more details.

Thanks to everyone using the plugin and reporting bugs. I’m aiming to get the plugin into good shape for the WP repository soon. It’ll probably stay in beta for a bit after that, but at least we’ll be able to auto-update :)

Rushkoff on branding

I usually keep posting here strictly to the techie nitty-gritty. But I thought that aside from this talk by Douglas Rushkoff directly addressing important issues around commerce and the internet, it’s also just a fundamentally important perspective.
Read more »

WordPress feeds mashup widget

I’ve put together a few little widgets in my time for client sites, dropped into my custom theme’s functions.php. I might look into putting them out there in a formalized way some time (plugins? a collection of code snippets?), but for now here’s one I just did that I think is pretty useful. It basically takes one or more feed URLs, and outputs the most recent items after merging the feeds together.

Read more »

WordPress Custom Fields plugin

Well, it turns out that my release of a “reloaded” version of my hugely popular custom fields theme code was a bit premature. I quickly realized that even though (or especially because) my target audience is developers, the code should become a plugin. The field definitions should be separate, in the theme, so the core plugin code can be easily update. D’uh!

So, while I’m not officially releasing the plugin yet on the WP repository, I thought I’d kick off a public beta. Check out the SLT Custom Fields plugin. Documentation is incomplete, and bugs may exist. However, all functionality seems to be working good on test sites. Use on production servers at your own risk, but please report any problems here.

I’m hoping this will grow into a powerful and stable tool for WordPress custom theme developers.

Read more »

Blog archive