From 3a8a6471e310097bab5c6656a6cb2a0e343cf003 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 6 Nov 2012 23:47:14 +0000 Subject: [PATCH] Check for WP_Error in get_the_category(). props batmoo. fixes #21155. git-svn-id: http://core.svn.wordpress.org/trunk@22412 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/category-template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index ceff339e49..8cf66c53bc 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -73,7 +73,7 @@ function get_category_parents( $id, $link = false, $separator = '/', $nicename = */ function get_the_category( $id = false ) { $categories = get_the_terms( $id, 'category' ); - if ( ! $categories ) + if ( ! $categories || is_wp_error( $categories ) ) $categories = array(); $categories = array_values( $categories );