From 1a2506c49317ba9c13877ef99e2da18219983ad0 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 18 Aug 2009 19:33:56 +0000 Subject: [PATCH] Don't show comments template if post is empty git-svn-id: https://develop.svn.wordpress.org/trunk@11839 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/comment-template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index a5ebcd1668..d9394cbc2d 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -813,7 +813,7 @@ function wp_comment_form_unfiltered_html_nonce() { function comments_template( $file = '/comments.php', $separate_comments = false ) { global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage; - if ( ! (is_single() || is_page() || $withcomments) ) + if ( !(is_single() || is_page() || $withcomments) || empty($post) ) return; if ( empty($file) )