How to (Almost) Fix Checked Categories in WordPress 2.5.1

Checked Categories come first in WordPress 2.5.1

May the blessings of Cthulhu fall upon the makers of Changeset 1299.

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 wp_category_checklist($post_ID) ?>
</ul>
</div>

But I had this:
<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:

<div id="categories-all" class="ui-tabs-panel">
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
<?php wp_category_checklist($post->ID, false, false, $popular_ids) ?> 
</ul>
</div>

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!

By | 2017-09-24T23:17:32+00:00 June 16th, 2008|Wordpress|3 Comments

3 Comments

  1. Douglas Porter June 22, 2008 at 10:56 pm

    I would love you forever if you figure this out!!! My wife is mad at me for upgrading to 2.5.1 :( Thanks for your work on this!

  2. Widge June 22, 2008 at 11:00 pm

    Stay tuned, my friend. I figure if I don’t hack this out somebody will, and when they do, I’ll report it here. Bribe her with flowers to bide you time…

  3. Douglas Porter June 22, 2008 at 11:05 pm

    Thanks! I’ll be tracking comments here via email :) I couldn’t agree more with your entire article; I love headsup displays…

Leave A Comment

%d bloggers like this: