Ticket #3556: category.php.diff

File category.php.diff, 0.5 kB (added by dougal, 2 years ago)

fix empty foreach warning

  • wp-includes/category.php

    old new  
    294294        } 
    295295 
    296296        // Transfer the touched cells  
    297         foreach ( $cat_items as $id => $items ) 
    298                 if ( isset($cats[$id]) ) 
    299                         $cats[$id]->{'link' == $type ? 'link_count' : 'category_count'} = count($items); 
     297        if (count($cat_items)) 
     298                foreach ( $cat_items as $id => $items ) 
     299                        if ( isset($cats[$id]) ) 
     300                                $cats[$id]->{'link' == $type ? 'link_count' : 'category_count'} = count($items); 
    300301} 
    301302 
    302303?>