WordPress.org

Make WordPress Core

Changeset 5179


Ignore:
Timestamp:
04/04/2007 10:32:24 PM (11 years ago)
Author:
ryan
Message:

Category listing speedups. see #3985

File:
1 edited

Legend:

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

    r5178 r5179  
    265265    $category_list = array();
    266266    $children = _get_category_hierarchy();
     267
     268    if  ( ( 0 != $category_id ) && ! isset($children[$category_id]) )
     269        return array();
     270
    267271    foreach ( $categories as $category ) {
    268272        if ( $category->cat_ID == $category_id )
     
    271275        if ( $category->category_parent == $category_id ) {
    272276            $category_list[] = $category;
     277
    273278            if ( !isset($children[$category->cat_ID]) )
    274279                continue;
Note: See TracChangeset for help on using the changeset viewer.