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

WordPress Trac wp-trac at lists.automattic.com
Sat Dec 11 12:12:37 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:  dev-feedback   
 On a test install of WP 3.1 [16732], I notice that this function is
 broken: it produces an error when called inside the single post template.

 Using this code :
 <?php echo get_category_parents($cat, TRUE, ' &raquo; '); ?>
 produces the following error message: ''Catchable fatal error: Object of
 class WP_Error could not be converted to string in (.../themes/twentyten
 /loop-single.php)''. This effects every post.

 I did not spot this error in 3.1-beta1-16723, so I believe it has been
 introduced after that build.

 To rule out any error in my custom theme, I tested it with the ''Twenty
 Ten 1.3-alpha'' theme, adding the function above inside ''loop-
 single.php'' (at line 32, just above the content). It produces the same
 error message.

 Possibly related issue: #7030

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

More information about the wp-trac mailing list