From 5af3c01ea21a65b0ddaef50e8a7f2f73970e4268 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 12 Sep 2008 19:18:39 +0000 Subject: [PATCH] Threaded comments improvements from DD32. see #7635 git-svn-id: https://develop.svn.wordpress.org/trunk@8876 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/comment-template.php | 40 +++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 36cf7e21d7..8ca1818bbf 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -878,17 +878,31 @@ class Walker_Comment extends Walker { var $db_fields = array ('parent' => 'comment_parent', 'id' => 'comment_ID'); function start_lvl(&$output, $depth, $args) { - if ( 'div' == $args['style'] ) - return; - - echo "\n"; + break; + } } function start_el(&$output, $comment, $depth, $args) { @@ -907,7 +921,7 @@ class Walker_Comment extends Walker { else $tag = 'li'; ?> - < "" id="comment-"> + < id="comment-">
@@ -925,7 +939,7 @@ class Walker_Comment extends Walker {
- 'div-comment')) ?> + 'div-comment')) ?>
@@ -934,6 +948,10 @@ class Walker_Comment extends Walker { } function end_el(&$output, $comment, $depth, $args) { + if ( !empty($args['end-callback']) ) { + call_user_func($args['end-callback'], $comment, $args, $depth); + return; + } if ( 'div' == $args['style'] ) echo "
\n"; else @@ -954,7 +972,7 @@ class Walker_Comment extends Walker { * @param $args string|array Additional arguments */ function wp_list_comments(&$comments, $args = array() ) { - $defaults = array('walker' => null, 'depth' => 3, 'style' => 'list', 'callback' => null); + $defaults = array('walker' => null, 'depth' => 3, 'style' => 'ul', 'callback' => null, 'end-callback' => null); $r = wp_parse_args( $args, $defaults );