mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-28 07:07:38 +02:00
Re-index categories in get_the_category(). Props greuben. Fixes #15442
git-svn-id: http://svn.automattic.com/wordpress/trunk@16888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ccd9189ca4
commit
244ad8dd17
@ -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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user