diff --git a/wp-includes/template-functions.php b/wp-includes/template-functions.php index b1f5a1ea31..c48a6ba171 100644 --- a/wp-includes/template-functions.php +++ b/wp-includes/template-functions.php @@ -1340,7 +1340,7 @@ function get_the_category() { return $categories; } -function get_category_link($echo = false, $category_id) { +function get_category_link($echo = false, $category_id, $category_nicename) { global $wpdb, $tablecategories, $post, $querystring_start, $querystring_equal, $siteurl, $blogfilename; $cat_ID = $category_id; $permalink_structure = get_settings('permalink_structure'); @@ -1349,7 +1349,7 @@ function get_category_link($echo = false, $category_id) { $file = "$siteurl/$blogfilename"; $link = $file.$querystring_start.'cat'.$querystring_equal.$cat_ID; } else { - $category_nicename = $wpdb->get_var("SELECT category_nicename FROM $tablecategories WHERE cat_ID = $category_id"); + if ('' == $category_nicename) $category_nicename = $wpdb->get_var("SELECT category_nicename FROM $tablecategories WHERE cat_ID = $category_id"); // Get any static stuff from the front $front = substr($permalink_structure, 0, strpos($permalink_structure, '%')); $link = $siteurl . $front . 'category/' . $category_nicename; @@ -1365,7 +1365,7 @@ function the_category($seperator = '') { echo '