From ba2842f32672074dddab6714071ae9e9e404dba5 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 24 Sep 2015 16:30:12 +0000 Subject: [PATCH] Comments: In `comments_template()`, set `$wp_query->comments_by_type` to empty array if not separating comments. The value becomes stale otherwise. Edge case. Props jakub.tyrcha. Fixes #14809. git-svn-id: https://develop.svn.wordpress.org/trunk@34503 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/comment-template.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wp-includes/comment-template.php b/src/wp-includes/comment-template.php index f8ebaecdcc..f3e55bf03e 100644 --- a/src/wp-includes/comment-template.php +++ b/src/wp-includes/comment-template.php @@ -1240,6 +1240,8 @@ function comments_template( $file = '/comments.php', $separate_comments = false if ( $separate_comments ) { $wp_query->comments_by_type = separate_comments($comments); $comments_by_type = &$wp_query->comments_by_type; + } else { + $wp_query->comments_by_type = array(); } $overridden_cpage = false;