From 364faf559e129f99243ec7a1822296a0662746cc Mon Sep 17 00:00:00 2001 From: dd32 Date: Fri, 2 Apr 2010 05:13:57 +0000 Subject: [PATCH] Move children of nested levels not shown to after the current element, not inside it like children. See #8841 git-svn-id: http://svn.automattic.com/wordpress/trunk@13938 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-template.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 34db4330b6..fdea3906ae 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -1312,11 +1312,6 @@ class Walker_Comment extends Walker { $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output ); } unset( $children_elements[ $id ] ); - } elseif ( $max_depth <= $depth + 1 && isset( $children_elements[$id]) ) { - // this elseif block is the only change from Walker::display_element() - foreach( $children_elements[ $id ] as $child ) - $this->display_element( $child, $children_elements, $max_depth, $depth, $args, $output ); - unset( $children_elements[ $id ] ); } if ( isset($newlevel) && $newlevel ){ @@ -1328,6 +1323,14 @@ class Walker_Comment extends Walker { //end this element $cb_args = array_merge( array(&$output, $element, $depth), $args); call_user_func_array(array(&$this, 'end_el'), $cb_args); + + if ( $max_depth <= $depth + 1 && isset( $children_elements[$id]) ) { + // this if block is the only change from Walker::display_element() + foreach ( $children_elements[ $id ] as $child ) + $this->display_element( $child, $children_elements, $max_depth, $depth, $args, $output ); + unset( $children_elements[ $id ] ); + } + } /**