Make WordPress Core


Ignore:
Timestamp:
11/07/2005 09:56:03 PM (21 years ago)
Author:
ryan
Message:

Object caching, round one.

File:
1 edited

Legend:

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

    r2978 r3011  
    127127
    128128function get_category_children($id, $before = '/', $after = '') {
    129         global $cache_categories;
    130 
    131         if ( !isset($cache_categories) )
    132                 update_category_cache();
    133 
    134         $c_cache = $cache_categories; // Can't do recursive foreach on a global, have to make a copy
    135         $chain = '';
    136         foreach ( $c_cache as $category ) {
     129        $cat_ids = get_all_category_ids();
     130        foreach ( $cat_ids as $cat_id ) {
     131                if ( $cat_id == $id)
     132                        continue;
     133
     134                $category = get_category($cat_id);
    137135                if ( $category->category_parent == $id ) {
    138136                        $chain .= $before.$category->cat_ID.$after;
Note: See TracChangeset for help on using the changeset viewer.