WordPress batch category editing

Need batch category editing in WordPress? So did I.

Note that this requires a bit of editing to work in the 1.3 alphas… In 1.3 the secondary menus are drawn for you so you need to remove it from this file. Also, to get it integrated with the WordPress installation you only need to edit the wp-admin/menu.php file and insert the following line in the appropriate place (doesn’t actually matter which line, per se, but somewhere around the correct area would be dandy).

[code lang="php"]$submenu['edit.php'][30] = array(__(’Batch Categories’), 1, ‘batch-categories.php’);[/code]

The only other gotcha is a little adjustment to the wp-admin/menu-header.php file. For whatever reason they’re doing a partial substring match to determine which submenu should have the “current” class prepended. The easiest way to not have both the “Categories” submenu and the “Batch Categories” submenu labeled as current is to change the -10 in the substr() invocation to a -15. Like so: [code lang="php"]if ( (substr($self, -15) == substr($item[2], -15)) …[/code]

November 17, 2004 • Posted in: Asides

2 Comments

Leave a Reply