summaryrefslogtreecommitdiffstats
path: root/wp-includes/classes.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-06-24 17:00:10 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-06-24 17:00:10 +0000
commit631c9bb4d60d242432052f56c00768392f42a392 (patch)
tree50d41b0248d5c5fb156c6d52020675208b77a3e6 /wp-includes/classes.php
parenta1fbe4e0694a66d7351e2f6280ab84568681e8e0 (diff)
downloadwordpress-mu-631c9bb4d60d242432052f56c00768392f42a392.tar.gz
wordpress-mu-631c9bb4d60d242432052f56c00768392f42a392.tar.xz
wordpress-mu-631c9bb4d60d242432052f56c00768392f42a392.zip
WP Merge to revision 8180
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1336 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/classes.php')
-rw-r--r--wp-includes/classes.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/wp-includes/classes.php b/wp-includes/classes.php
index a454bef..289b27e 100644
--- a/wp-includes/classes.php
+++ b/wp-includes/classes.php
@@ -429,7 +429,8 @@ class Walker {
if ( $max_depth == 0 ||
($max_depth != 0 && $max_depth > $depth+1 )) { //whether to descend
- for ( $i = 0; $i < sizeof( $children_elements ); $i++ ) {
+ $num_elements = sizeof( $children_elements );
+ for ( $i = 0; $i < $num_elements; $i++ ) {
$child = $children_elements[$i];
if ( $child->$parent_field == $element->$id_field ) {
@@ -442,6 +443,7 @@ class Walker {
}
array_splice( $children_elements, $i, 1 );
+ $num_elements--;
$this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output );
$i = -1;
}
@@ -508,12 +510,14 @@ class Walker {
if ( !$top_level_elements ) {
$root = $children_elements[0];
- for ( $i = 0; $i < sizeof( $children_elements ); $i++ ) {
+ $num_elements = sizeof($children_elements);
+ for ( $i = 0; $i < $num_elements; $i++ ) {
$child = $children_elements[$i];
if ($root->$parent_field == $child->$parent_field ) {
$top_level_elements[] = $child;
array_splice( $children_elements, $i, 1 );
+ $num_elements--;
$i--;
}
}