Many Eyes, Bugs Being Shallow, All That

WordPress 2.5.1 added a really powerful feature to register_taxonomy(): automatic registration of permalinks and query vars to match the taxonomy. Well, theoretically it added that feature. It wasn’t working in practice. After some searching yesterday and today, I finally found the bug and worked up a fix. I made a diff and set off to open a ticket in Trac.

On the one hand I’m glad I searched first, because it turns out that a ticket on the very same issue was opened on May 16th and it already has a fix. On the other hand, it’s kind of a kicker to have lost my chance at reporting the bug and submitting a fix by only a few days.

The fix is committed for WordPress 2.6, but I’ve done a workaround for 2.5.1 (workarounds are easier to manage than core code changes). I’d say I wish I searched Trac first, but I wouldn’t have known what to search for if I didn’t figure out how to fix the bug first. And I guess I really can’t complain about a community that quickly finds and fixes bugs.

3 thoughts on “Many Eyes, Bugs Being Shallow, All That

  1. @Jason DeVelvis:

    Sorry, I should have included that.

    In addition to $taxonomy and $object_type, register_taxonomy() now also accepts an array of args. The defaults are as follows:

    array('hierarchical' => false, 'update_count_callback' => '', 'rewrite' => true, 'query_var' => true)

    The bug only shows itself if you use the defaults and don’t submit your own args. My work around was to call register_taxonomy() with an array that included 'query_var' => MyTaxonomyName

  2. Hello – this is really the only page I have found about using this function. With this are you able to create a new taxonomy such as MyTags and have that apply to posts? I.e. so you can have the normal tags as one taxonomy and then MyTags as another?

    Obvioulsy I would need to edit the form for adding etc. but I have not been able to find out if this is the right function for doing this. Any advice would be much appreciated!

    Chris.

Comments are closed.