function dropdown_categories($default = 0) { write_nested_categories(get_nested_categories($default)); }
function fwp_category_checklist($post_id = 0, $descendents_and_self = 0, $selected_cats = false, $prefix = '') { if (function_exists('wp_category_checklist')) { $walker = new FeedWordPress_Walker_Category_Checklist(); $walker->set_prefix($prefix); wp_category_checklist($post_id, $descendents_and_self, $selected_cats, false, $walker); } else { // selected_cats is an array of integer cat_IDs / term_ids for // the categories that should be checked global $post_ID; $cats = get_nested_categories(); // Undo damage from usort() in WP 2.0 $dogs = array(); foreach ($cats as $cat) { $dogs[$cat['cat_ID']] = $cat; } foreach ($selected_cats as $cat_id) { $dogs[$cat_id]['checked'] = true; } write_nested_categories($dogs); } }