Don't show comments template if post is empty

git-svn-id: http://svn.automattic.com/wordpress/trunk@11839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-08-18 19:33:56 +00:00
parent 8513b29792
commit 91ef366300
1 changed files with 1 additions and 1 deletions

View File

@ -813,7 +813,7 @@ function wp_comment_form_unfiltered_html_nonce() {
function comments_template( $file = '/comments.php', $separate_comments = false ) { 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; 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; return;
if ( empty($file) ) if ( empty($file) )