diff --git a/wp-includes/template-functions-category.php b/wp-includes/template-functions-category.php index 068508c84e..319695f5b2 100644 --- a/wp-includes/template-functions-category.php +++ b/wp-includes/template-functions-category.php @@ -59,60 +59,67 @@ function get_category_rss_link($echo = false, $category_id, $category_nicename) function the_category($seperator = '', $parents='') { $categories = get_the_category(); + $thelist = ''; if ('' == $seperator) { - echo ''; } else { $i = 0; foreach ($categories as $category) { $category->cat_name = stripslashes($category->cat_name); - if (0 < $i) echo $seperator . ' '; + if (0 < $i) $thelist .= $seperator . ' '; switch(strtolower($parents)) { case 'multiple': - if ($category->category_parent) echo get_category_parents($category->category_parent, TRUE); - echo 'cat_name) . '">'.$category->cat_name.''; + if ($category->category_parent) $thelist .= get_category_parents($category->category_parent, TRUE); + $thelist .= 'cat_name) . '">'.$category->cat_name.''; case 'single': - echo 'cat_name) . '">'; - if ($category->category_parent) echo get_category_parents($category->category_parent, FALSE); - echo "$category->cat_name"; + $thelist .= 'cat_name) . '">'; + if ($category->category_parent) $thelist .= get_category_parents($category->category_parent, FALSE); + $thelist .= "$category->cat_name"; case '': default: - echo 'cat_name) . '">'.$category->cat_name.''; + $thelist .= 'cat_name) . '">'.$category->cat_name.''; } ++$i; } } + echo apply_filters('the_category', $thelist); } function the_category_rss($type = 'rss') { $categories = get_the_category(); + $the_list = ''; foreach ($categories as $category) { $category->cat_name = stripslashes(convert_chars($category->cat_name)); if ('rdf' == $type) { - echo "\n\t$category->cat_name"; + $the_list .= "\n\t$category->cat_name"; } else { - echo "\n\t$category->cat_name"; + $the_list .= "\n\t$category->cat_name"; } } - + echo apply_filters('the_category_rss', $the_list).'kgg'; } function get_the_category_by_ID($cat_ID) { @@ -403,6 +410,6 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde if ($recurse) { return $thelist; } - echo $thelist; + echo apply_filters('list_cats', $thelist); } ?> \ No newline at end of file