From 0e2909ce892b2f208133da502b4d56d205fa3e55 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 15 May 2014 06:43:15 +0000 Subject: [PATCH] Eliminate the use of `extract()` in `wp_list_comments()`. All unit tests pass. See #22400. Built from https://develop.svn.wordpress.org/trunk@28428 git-svn-id: http://core.svn.wordpress.org/trunk@28255 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-template.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 7af6406621..400f0b1f95 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -1984,20 +1984,22 @@ function wp_list_comments( $args = array(), $comments = null ) { if ( null === $r['reverse_top_level'] ) $r['reverse_top_level'] = ( 'desc' == get_option('comment_order') ); - extract( $r, EXTR_SKIP ); - - if ( empty($walker) ) + if ( empty( $r['walker'] ) ) { $walker = new Walker_Comment; + } else { + $walker = $r['walker']; + } - $output = $walker->paged_walk($_comments, $max_depth, $page, $per_page, $r); + $output = $walker->paged_walk( $_comments, $r['max_depth'], $r['page'], $r['per_page'], $r ); $wp_query->max_num_comment_pages = $walker->max_pages; $in_comment_loop = false; - if ( $r['echo'] ) + if ( $r['echo'] ) { echo $output; - else + } else { return $output; + } } /**