Category listing speedups. see #3985

git-svn-id: http://svn.automattic.com/wordpress/trunk@5179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-04-04 22:32:24 +00:00
parent 7f0a905ee6
commit 2c31712d3a
1 changed files with 5 additions and 0 deletions

View File

@ -264,12 +264,17 @@ function &_get_cat_children($category_id, $categories) {
$category_list = array();
$children = _get_category_hierarchy();
if ( ( 0 != $category_id ) && ! isset($children[$category_id]) )
return array();
foreach ( $categories as $category ) {
if ( $category->cat_ID == $category_id )
continue;
if ( $category->category_parent == $category_id ) {
$category_list[] = $category;
if ( !isset($children[$category->cat_ID]) )
continue;