How to (Almost) Fix Checked Categories in WordPress 2.5.1

Ken and I discuss often about why in the world functionality should disappear when upgrading. Upgrade and loss of functionality shouldn’t go together. Granted, this isn’t something that’s unique to WordPress. There’s a fine tradition of cool bits inexplicably going away in software, cars, you name it. I’m looking at you, Microsoft. I’m looking at you, car industry. Headsup displays are cool, you jerks.

Anyway, I’m posting this because it took searching on stuff like “categorychecklist” and “dropdown_categories” before I came across the changeset that would make your checked categories appear first just like in previous versions. And, of course, one of the files, edit-form-advanced.php, is also covered by the write post panel hack that puts the categories and such back on the right hand side where they belong. So I was concerned that I might blow up one hack with yet another hack.

The changeset calls for this, which for me was lines 164-168 of /wp-admin/edit-form-advanced.php:

<div id="categories-all" class="ui-tabs-panel">
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
<?php dropdown_categories(); ?>
</ul>
</div>
So I figured what the hell, and replaced that line with what the changeset said to, making the whole thing look like this:

So nothing–so far at least–has blown up after doing this. But it’s sooo much better now that I don’t have to scroll up and down to see all the checked categories. I think the WP developers must have stock in mice. And wrist braces.

Update: Well, that’s what I get for hacking WordPress with a WordPress MU change. But dammit, it does work. I’m getting an error–not a fatal one, just a warning. So don’t screw with this till I work it out. Stand by.

Update: Dammit. Can’t make it work. I keep getting this non-fatal error:

[error]

PHP Warning: in_array()
[<a href='function.in-array'>function.in-array</a>]:
Wrong datatype for second argument in
*directory tree*/httpdocs/wp-admin/includes/template.php on line 143

referred by post-new.php or wherever I’m working in the edit screen. If anybody knows how to fix that, let me know. I tried using $this-> but apparently what I’m screwing around with isn’t a class. Damn this oppression!