From acfb79c47e9ef779616c24485071d2bfe2d7ec01 Mon Sep 17 00:00:00 2001 From: rboren Date: Fri, 12 Nov 2004 23:08:51 +0000 Subject: [PATCH] Sort the category list so that index associations are made non-sparse. git-svn-id: http://svn.automattic.com/wordpress/trunk@1851 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/template-functions-category.php | 6 ++++-- wp-includes/template-functions-links.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/template-functions-category.php b/wp-includes/template-functions-category.php index 03686c9b6..501b00c68 100644 --- a/wp-includes/template-functions-category.php +++ b/wp-includes/template-functions-category.php @@ -8,7 +8,7 @@ function get_the_category($id = false) { } if ($category_cache[$id]) { - return $category_cache[$id]; + $categories = $category_cache[$id]; } else { $categories = $wpdb->get_results(" SELECT category_id, cat_name, category_nicename, category_description, category_parent @@ -16,8 +16,10 @@ function get_the_category($id = false) { WHERE $wpdb->post2cat.category_id = cat_ID AND $wpdb->post2cat.post_id = '$id' "); - return $categories; } + + sort($categories); + return $categories; } function get_category_link($echo = false, $category_id, $category_nicename) { diff --git a/wp-includes/template-functions-links.php b/wp-includes/template-functions-links.php index bc85f13ab..7a94e1ac1 100644 --- a/wp-includes/template-functions-links.php +++ b/wp-includes/template-functions-links.php @@ -52,7 +52,7 @@ function get_permalink($id = false) { if ($idpost->post_status == 'static') { return get_page_link(); } - + $permalink = get_settings('permalink_structure'); if ('' != $permalink) {