Properly force variable to an array. props Viper007Bond, fixes #15407.
git-svn-id: https://develop.svn.wordpress.org/trunk@16395 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
348236aeb7
commit
55f599d330
|
@ -65,8 +65,10 @@ function get_category_parents( $id, $link = false, $separator = '/', $nicename =
|
||||||
*/
|
*/
|
||||||
function get_the_category( $id = false ) {
|
function get_the_category( $id = false ) {
|
||||||
$categories = get_the_terms( $id, 'category' );
|
$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] );
|
_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 are return alot of categories not just one
|
||||||
|
|
Loading…
Reference in New Issue