From 595bad9f37d13e396b3cc520ca05b1ae6d782a5b Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 24 Sep 2015 16:31:24 +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. Built from https://develop.svn.wordpress.org/trunk@34503 git-svn-id: http://core.svn.wordpress.org/trunk@34467 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment-template.php | 2 ++ wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index f8ebaecdcc..f3e55bf03e 100644 --- a/wp-includes/comment-template.php +++ b/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; diff --git a/wp-includes/version.php b/wp-includes/version.php index b48079bc47..1dc52bdfbc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34502'; +$wp_version = '4.4-alpha-34503'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.