From b506da37ff1759ceeae3d0b922a1bff419c2e35e Mon Sep 17 00:00:00 2001 From: alex_t_king Date: Thu, 15 Jan 2004 01:28:41 +0000 Subject: [PATCH] enabled using Category Description as the title attribute in list_cats and made the displayed text use htmlspecialchars git-svn-id: http://svn.automattic.com/wordpress/trunk@778 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/template-functions.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/wp-includes/template-functions.php b/wp-includes/template-functions.php index c019d5a73f..11afebaef2 100644 --- a/wp-includes/template-functions.php +++ b/wp-includes/template-functions.php @@ -1485,7 +1485,7 @@ function dropdown_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_ } // out of the WordPress loop -function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, $optioncount = 0, $hide_empty = 1) { +function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 0) { global $tablecategories, $tableposts, $tablepost2cat, $wpdb; global $pagenow, $siteurl, $blogfilename; global $querystring_start, $querystring_equal, $querystring_separator; @@ -1496,11 +1496,10 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde $sort_column = 'cat_'.$sort_column; $query = " - SELECT cat_ID, cat_name, category_nicename + SELECT cat_ID, cat_name, category_nicename, category_description FROM $tablecategories WHERE cat_ID > 0 - "; - $query .= " ORDER BY $sort_column $sort_order"; + ORDER BY $sort_column $sort_order"; $categories = $wpdb->get_results($query); @@ -1529,7 +1528,14 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde } foreach ($categories as $category) { - $link = ''; + $link = 'category_description)) { + $link .= 'title="View all posts filed under ' . htmlspecialchars($category->cat_name) . '"'; + } + else { + $link .= 'title="' . htmlspecialchars($category->category_description) . '"'; + } + $link .= '>'; $link .= stripslashes($category->cat_name).''; if (intval($optioncount) == 1) { $link .= ' ('.$category_posts["$category->cat_ID"].')';