mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 19:46:21 +00:00
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
This commit is contained in:
parent
c121aa0ae3
commit
d042642802
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user