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
This commit is contained in:
scribu 2010-12-12 20:32:29 +00:00
parent 06622f69ba
commit b514837458
1 changed files with 4 additions and 1 deletions

View File

@ -68,10 +68,13 @@ function get_the_category( $id = false ) {
if ( ! $categories ) if ( ! $categories )
$categories = array(); $categories = array();
$categories = array_values( $categories );
foreach ( array_keys( $categories ) as $key ) { foreach ( array_keys( $categories ) as $key ) {
_make_cat_compat( $categories[$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 ); return apply_filters( 'get_the_categories', $categories );
} }