WordPress 3.4 is out…
For more information view the blog post on WordPress.org
My little contribution is one tiny commit, but it fixes an issue which I find incredibly frustrating when managing a site with a large about of hierarchical categories (or other hierarchical taxonomies).
Checked on top
When you check categories when editing a post in WordPress, after saving checked categories appear at the top of the list.
The makes sense if you have many non-hierarchical categories and it makes it easy for you to deselect categories without having to scroll through a long list.
However, when dealing with hierarchical categories and sub-categories, all checked options still jump to the top, moving out of the hierarchical structure. This makes it difficult to identify which checked categories are top level and which are sub-categories and is particularly confusing if you have sub-categories with the same name under different parent categories.
Introducing the wp_terms_checklist_args filter
The new filter allows you to filter all checklist arguments including the ‘checked_ontop’ variable.
$defaults = array( 'descendants_and_self' => 0, 'selected_cats' => false, 'popular_cats' => false, 'walker' => null, 'taxonomy' => 'category', 'checked_ontop' => true ); $args = apply_filters( 'wp_terms_checklist_args', $args, $post_id );