Order cats by name. Props davidhouse. fixes #1780

git-svn-id: https://develop.svn.wordpress.org/trunk@3000 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2005-11-06 06:48:41 +00:00
parent 6f6ef95a3a
commit 5679c4dd36
1 changed files with 7 additions and 1 deletions

View File

@ -439,7 +439,11 @@ function checked($checked, $current) {
function return_categories_list($parent = 0) {
global $wpdb;
return $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent ORDER BY category_count DESC");
return $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent");
}
function sort_cats($cat1, $cat2) {
return strcasecmp($cat1['cat_name'], $cat2['cat_name']);
}
function get_nested_categories($default = 0, $parent = 0) {
@ -472,6 +476,8 @@ function get_nested_categories($default = 0, $parent = 0) {
$result[$cat]['cat_name'] = get_the_category_by_ID($cat);
}
}
usort($result, 'sort_cats');
return $result;
}