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
This commit is contained in:
Scott Taylor 2014-05-15 06:43:15 +00:00
parent a15d498d1a
commit 0e2909ce89
1 changed files with 8 additions and 6 deletions

View File

@ -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;
}
}
/**