Make WordPress Core


Ignore:
Timestamp:
04/04/2007 08:44:45 PM (19 years ago)
Author:
ryan
Message:

Cache category hierarchy to make cat listing faster. Phase 1. see #3985

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-functions.php

    r5152 r5178  
    792792        $categories = get_categories( 'hide_empty=0' );
    793793
     794    $children = _get_category_hierarchy();
     795
    794796    if ( $categories ) {
    795797        ob_start();
     
    797799            if ( $category->category_parent == $parent) {
    798800                echo "\t" . _cat_row( $category, $level );
    799                 cat_rows( $category->cat_ID, $level +1, $categories );
     801                if ( isset($children[$category->cat_ID]) )
     802                    cat_rows( $category->cat_ID, $level +1, $categories );
    800803            }
    801804        }
Note: See TracChangeset for help on using the changeset viewer.