From d042642802127a24dd7c691519ffd58a060c0d69 Mon Sep 17 00:00:00 2001 From: nacin Date: Tue, 16 Nov 2010 00:19:51 +0000 Subject: [PATCH] Properly force variable to an array. props Viper007Bond, fixes #15407. git-svn-id: http://svn.automattic.com/wordpress/trunk@16395 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/category-template.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 70a21a866..9f15a87da 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -65,8 +65,10 @@ function get_category_parents( $id, $link = false, $separator = '/', $nicename = */ function get_the_category( $id = false ) { $categories = get_the_terms( $id, 'category' ); + if ( ! $categories ) + $categories = array(); - foreach ( array_keys( (array) $categories ) as $key ) { + foreach ( array_keys( $categories ) as $key ) { _make_cat_compat( $categories[$key] ); } // Filter name is plural because we are return alot of categories not just one