[wp-cvs] wordpress/wp-includes template-functions-category.php, 1.29, 1.30

Ryan Boren rboren at users.sourceforge.net
Thu May 27 16:19:39 CDT 2004


Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24223

Modified Files:
	template-functions-category.php 
Log Message:
Fix up the_category_ID() and the_category_head() to maintain backwards compat.  Mark as deprecated.

Index: template-functions-category.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/template-functions-category.php,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** template-functions-category.php	24 May 2004 08:22:18 -0000	1.29
--- template-functions-category.php	27 May 2004 21:19:37 -0000	1.30
***************
*** 165,179 ****
  }
  
  function the_category_ID($echo = true) {
!     global $post;
!     if ($echo)
!         echo $post->post_category;
!     else
!         return $post->post_category;
  }
  
  function the_category_head($before='', $after='') {
!     global $post, $currentcat, $previouscat, $dateformat, $newday;
!     $currentcat = $post->post_category;
      if ($currentcat != $previouscat) {
          echo $before;
--- 165,185 ----
  }
  
+ // Deprecated.
  function the_category_ID($echo = true) {
!     // 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 $currentcat, $previouscat;
!     // Grab the first cat in the list.
!     $categories = get_the_category();
!     $currentcat = $categories[0]->category_id;
      if ($currentcat != $previouscat) {
          echo $before;




More information about the cvs mailing list