In-progress WordPress plug-in: Windows Liver Writer tagging for Ultimate Tag Warrior
Recently I’ve been doing most of my writing here using Windows Live Writer (WLW) (download). More about that in a later post, but suffice it to say that it’s been a great tool so far. As a beta from Microsoft, this one shines.
One frustration I had, though, was tagging support. In the post meta-data there’s a field for keywords, which seemed like a sensible place to put tags, but out of the box there was no connection between that field and anything in WordPress (because there’s no built-in tag support in WordPress,I imagine).
For the growing tagging efforts here at elliptical… I use the popular Ultimate Tag Warrior (UTW) (thanks, Christine!) and there are a few mechanisms out there for connection Windows Live Writer to Ultimate Tag Warrior. I wouldn’t be out of line, I think, to call these methods hacks – one requires edits to WordPress’s xmlrpc.php file, a hack indeed, and the other involves embedding the tags in the post content and telling UTW to extract them (you can make this one a little easier by using a WLW plugin called Tag4Writer). I didn’t want to delve into hacking xmlrpc.php, and I’d quickly tire of having to remember to put the tags in the post content. A plugin was clearly in order.
Extending xmlrpc.php via a plugin is kind of a pain, as it turns out. Using the most excellent WordPress Hooks Database, I discovered that there’s only one WordPress filter available in that file, and no hooks to attach user functions to. To top that off, the filter only passes a list of the XML-RPC blogging APIs and the associated functions within xmlrpc.php that handle those api calls. You can replace any of those function calls with a function of your own and pass back the list, which is what I did, adding functions in my plugin to call the Ultimate Tag Warrior functions with the mt_keywords record within the MetaWeblog API’s struct (which also contains the posts’s title, link, description, and excerpt). My PHP-fu wasn’t very good while I was working on this, and as a result I was unable to call out to $wp_xmlrpc_server to utilize the escape() and login_pass_ok() functions, and so had to replicate them within my plugin (pointers on how to call back to the xmlrpc server for these functions are most welcome).
Having only tested this briefly I’m not quite ready to release the code yet but wanted to document what I’ve done a little bit.
