From b5148374587bd69bb4f673a5bea1b1bee6f4ae96 Mon Sep 17 00:00:00 2001 From: scribu Date: Sun, 12 Dec 2010 20:32:29 +0000 Subject: [PATCH] Re-index categories in get_the_category(). Props greuben. Fixes #15442 git-svn-id: https://develop.svn.wordpress.org/trunk@16888 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/category-template.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 9aae78eecb..8b001c5fbc 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -67,11 +67,14 @@ function get_the_category( $id = false ) { $categories = get_the_terms( $id, 'category' ); if ( ! $categories ) $categories = array(); + + $categories = array_values( $categories ); 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 + + // Filter name is plural because we return alot of categories not just one return apply_filters( 'get_the_categories', $categories ); }