WordPress.org

Make WordPress Core

Changeset 16395


Ignore:
Timestamp:
11/16/2010 12:19:51 AM (10 years ago)
Author:
nacin
Message:

Properly force variable to an array. props Viper007Bond, fixes #15407.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/category-template.php

    r16343 r16395  
    6666function get_the_category( $id = false ) {
    6767    $categories = get_the_terms( $id, 'category' );
    68 
    69     foreach ( array_keys( (array) $categories ) as $key ) {
     68    if ( ! $categories )
     69        $categories = array();
     70
     71    foreach ( array_keys( $categories ) as $key ) {
    7072        _make_cat_compat( $categories[$key] );
    7173    }
Note: See TracChangeset for help on using the changeset viewer.