[wp-trac] [WordPress Trac] #15776: get_category_parents produces fatal error

WordPress Trac wp-trac at lists.automattic.com
Sat Dec 11 16:12:33 UTC 2010


#15776: get_category_parents produces fatal error
--------------------------+-------------------------------------------------
 Reporter:  tar.gz        |       Owner:                   
     Type:  defect (bug)  |      Status:  new              
 Priority:  normal        |   Milestone:  Awaiting Review  
Component:  General       |     Version:  3.1              
 Severity:  normal        |    Keywords:  reporter-feedback
--------------------------+-------------------------------------------------

Comment(by tar.gz):

 Thanks for the clarification. Indeed my testing was incomplete, $cat needs
 to be defined. The code that I am using successfully in 3.0.3 (in order to
 generate a breadcrumbs trail) looks like this:

 {{{
 <?php
  if ( is_single() ) {
  $cat = get_the_category(); $cat = $cat[0];
  echo(get_category_parents($cat, TRUE, ' &gt; ')); }
 ?>
 }}}

 The line that gets flagged in the error message is the line with
 ''echo(get_category_parents'' ... -- that's what brought me to believe
 that there was an issue with this function.

 It might very well be that there is a conceptual flaw in my code, but it
 was working until now.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15776#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list