diff --git a/src/wp-includes/class-wp-comment-query.php b/src/wp-includes/class-wp-comment-query.php index e185ceb40e..bbc6fe2d66 100644 --- a/src/wp-includes/class-wp-comment-query.php +++ b/src/wp-includes/class-wp-comment-query.php @@ -481,8 +481,7 @@ class WP_Comment_Query { $_comments = apply_filters_ref_array( 'the_comments', array( $_comments, &$this ) ); // Convert to WP_Comment instances. - array_walk( $_comments, 'get_comment' ); - $comments = $_comments; + $comments = array_map( 'get_comment', $_comments ); if ( $this->query_vars['hierarchical'] ) { $comments = $this->fill_descendants( $comments ); diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php index 150acd6f1a..10e9d864ad 100644 --- a/src/wp-includes/comment.php +++ b/src/wp-includes/comment.php @@ -192,7 +192,7 @@ function get_approved_comments( $post_id, $args = array() ) { * respectively. Default OBJECT. * @return WP_Comment|array|null Depends on $output value. */ -function get_comment( &$comment = null, $output = OBJECT ) { +function get_comment( $comment = null, $output = OBJECT ) { if ( empty( $comment ) && isset( $GLOBALS['comment'] ) ) { $comment = $GLOBALS['comment']; }