A Dirty Hack to Fix the Disappearing Tags Problem in Ultimate Tag Warrior
Ultimate Tag Warrior is a great Wordpress plugin that lets you add tagging to your blog and build your own folksonomy. You can use it to show related posts or a nifty tag cloud.
As of version 2.3, though, Worpdress has tagging built right in. That means that development on UTW has stopped, leaving us with a very nasty bug in the final version. After someone comments on a post (and the comment is approved), all the non-category tags are deleted.
This is a known bug in UTW 3.1415926. I’m not quite ready to take the plunge into Wordpress 2.3, digging up new plugins to add the features I want and changing our theme. So in the mean time, I found an ugly hack to stop our tags from vanshing into thin air.
- Go to your ultimate-tag-warrior-core.php file.
- Find the SaveTags function.
- Comment out the code that removes tags that are no longer associated with the post.
The end of the SaveTags function should look like this:
// Remove any tags that are no longer associated with the post.
/*
if ($taglist == “”) {
// since “not in ()” doesn’t play nice.
$q = “delete from $tablepost2tag where post_id = $postID”;
} else {
// lop off the trailing space+comma
$taglist = substr($taglist, 0 ,-2);$q = “delete from $tablepost2tag where post_id = $postID and tag_id not in ($taglist)”;
}
$wpdb->query($q);
*/
$this->ClearTagPostMeta($postID);
}
Please note that this is an ugly hack. It makes it much more difficult to remove tags from a post when you want to. I find that we get comments on posts way more often than we ever want to remove tags, so it’s a god tradeoff for the time being.
Got a better solution? Post it in the comment below.
Recently I have been trying to plan my second trip to Japan and i am finding it incredibly hard. We had even considered just going to Europe to save a little bit of money, you know, by not traveling all around the globe. Usually I plan everything and do everything myself, but this year I wanted to do something “all inclusive” so I could actually enjoy and relax on my vacation instead of stressing out over whether everything was going as planned. You know, so I could have fun on my vacation?