Category listing speedups. see #3985
git-svn-id: https://develop.svn.wordpress.org/trunk@5179 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
93cdc6deac
commit
c81341f3ee
@ -264,12 +264,17 @@ function &_get_cat_children($category_id, $categories) {
|
|||||||
|
|
||||||
$category_list = array();
|
$category_list = array();
|
||||||
$children = _get_category_hierarchy();
|
$children = _get_category_hierarchy();
|
||||||
|
|
||||||
|
if ( ( 0 != $category_id ) && ! isset($children[$category_id]) )
|
||||||
|
return array();
|
||||||
|
|
||||||
foreach ( $categories as $category ) {
|
foreach ( $categories as $category ) {
|
||||||
if ( $category->cat_ID == $category_id )
|
if ( $category->cat_ID == $category_id )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ( $category->category_parent == $category_id ) {
|
if ( $category->category_parent == $category_id ) {
|
||||||
$category_list[] = $category;
|
$category_list[] = $category;
|
||||||
|
|
||||||
if ( !isset($children[$category->cat_ID]) )
|
if ( !isset($children[$category->cat_ID]) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user