From bd9c5a9bb44fbcc6db4f3c4dcbb88dc9aeb72c72 Mon Sep 17 00:00:00 2001 From: rboren Date: Thu, 27 May 2004 21:19:37 +0000 Subject: [PATCH] Fix up the_category_ID() and the_category_head() to maintain backwards compat. Mark as deprecated. git-svn-id: http://svn.automattic.com/wordpress/trunk@1368 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/template-functions-category.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/wp-includes/template-functions-category.php b/wp-includes/template-functions-category.php index 5dc45d167..59f21e7e5 100644 --- a/wp-includes/template-functions-category.php +++ b/wp-includes/template-functions-category.php @@ -164,17 +164,23 @@ function get_category_children($id, $before = '/', $after = '') { return $chain; } +// Deprecated. function the_category_ID($echo = true) { - global $post; - if ($echo) - echo $post->post_category; - else - return $post->post_category; + // Grab the first cat in the list. + $categories = get_the_category(); + $cat = $categories[0]->category_id; + + if ($echo) echo $cat; + + return $cat; } +// Deprecated. function the_category_head($before='', $after='') { - global $post, $currentcat, $previouscat, $dateformat, $newday; - $currentcat = $post->post_category; + global $currentcat, $previouscat; + // Grab the first cat in the list. + $categories = get_the_category(); + $currentcat = $categories[0]->category_id; if ($currentcat != $previouscat) { echo $before; echo get_the_category_by_ID($currentcat);