From 1ba0025c6052d36e3eadeb74681e80f1f27d00ad Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 18 Feb 2008 17:46:26 +0000 Subject: [PATCH] Add optional post ID arg to the_category and get_the_category_list. Props filosofo. fixes #5050 git-svn-id: http://svn.automattic.com/wordpress/trunk@6899 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/category-template.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 4b780b8af2..9537ceb7d5 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -109,9 +109,9 @@ function get_the_category_by_ID($cat_ID) { return $category->name; } -function get_the_category_list($separator = '', $parents='') { +function get_the_category_list($separator = '', $parents='', $post_id = false) { global $wp_rewrite; - $categories = get_the_category(); + $categories = get_the_category($post_id); if (empty($categories)) return apply_filters('the_category', __('Uncategorized'), $separator, $parents); @@ -179,8 +179,8 @@ function in_category( $category ) { // Check if the current post is in the given return false; } -function the_category($separator = '', $parents='') { - echo get_the_category_list($separator, $parents); +function the_category($separator = '', $parents='', $post_id = false) { + echo get_the_category_list($separator, $parents, $post_id); } function category_description($category = 0) {