Since upgrading to WordPress 2.1.3 a few days ago, I’ve noticed tags disappearing on some of my posts. I currently use Bunny’s Technorati Tags, which stores them in custom fields.

It turns out there’s been a known problem since WordPress 2.1 was released two months ago. Some plugin hooks have changed, and plugins that used to only get called during post editing are also getting called during comment publishing. I grabbed an updated version of the plugin, and it seems okay now.

Oddly, most (but not all) tags survived unscathed during the two months running earlier 2.1 releases. It’s only since moving to 2.1.3 that it’s been consistent. Oh, well, at least it prompted me to find the fix.

Solved! To make Bunny’s Technorati Tags fully compatible with WordPress 2.0 you need to change two lines in the add_tags_textinput() function.

Just replace this:

function add_tags_textinput() {
	global $postdata;
	$tags = get_post_meta($postdata->ID, 'tags', true);

with this:

function add_tags_textinput() {
	global $post_ID;
	$tags = get_post_meta($post_ID, 'tags', true);

The problem is that it will show existing tags, or let you add a new tag, but it will lose tags when you edit a post. It’s not able to retrieve the tags to fill in the form field, apparently because $postdata isn’t returning the ID it expects.

I’ve submitted the fix to wp-plugins.org, so if the author is keeping track of tickets there, the fix should show up in the next version of the plugin.

Update Jan. 3: The plugin author has released version 0.5 with a slightly different fix (plus a few other improvements), and it’s now compatible with WordPress 2.0.

I’ve been experimenting with tags, particularly aimed at Technorati, and I rather like being able to add ad-hoc categories and (I hope) increase the visibility of some posts. I’ve rigged up some style rules (that so far only work in Gecko and KHTML-based browsers, since they rely on the substring attribute selector from CSS3 and no one else has implemented that yet), but typing out <a href="http://technorati.com/tag/whatever" rel="tag">whatever</a> over and over has gotten tiresome. Enter Bunny’s Technorati Tags, which automatically handles them using WordPress’ extensible custom fields. No muss, no fuss, just type in the words in another form field.

One thing I haven’t figured out yet: since the list is separated by spaces, how do you specify a multi-word tag like “Internet Explorer”?

To be honest, this post only exists because I want to test it, and because there seems to be a tradition of “I just installed this neat new plugin” posts. Continue reading