Fix up the_category_ID() and the_category_head() to maintain backwards compat. Mark as deprecated.

git-svn-id: https://develop.svn.wordpress.org/trunk@1368 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2004-05-27 21:19:37 +00:00
parent 546e0da910
commit 035a6402d2
1 changed files with 13 additions and 7 deletions

View File

@ -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);