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
This commit is contained in:
rboren 2004-05-27 21:19:37 +00:00
parent aafd840acd
commit bd9c5a9bb4
1 changed files with 13 additions and 7 deletions

View File

@ -164,17 +164,23 @@ function get_category_children($id, $before = '/', $after = '') {
return $chain; return $chain;
} }
// Deprecated.
function the_category_ID($echo = true) { function the_category_ID($echo = true) {
global $post; // Grab the first cat in the list.
if ($echo) $categories = get_the_category();
echo $post->post_category; $cat = $categories[0]->category_id;
else
return $post->post_category; if ($echo) echo $cat;
return $cat;
} }
// Deprecated.
function the_category_head($before='', $after='') { function the_category_head($before='', $after='') {
global $post, $currentcat, $previouscat, $dateformat, $newday; global $currentcat, $previouscat;
$currentcat = $post->post_category; // Grab the first cat in the list.
$categories = get_the_category();
$currentcat = $categories[0]->category_id;
if ($currentcat != $previouscat) { if ($currentcat != $previouscat) {
echo $before; echo $before;
echo get_the_category_by_ID($currentcat); echo get_the_category_by_ID($currentcat);