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:
parent
8513b29792
commit
91ef366300
|
@ -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) )
|
||||
|
|
Loading…
Reference in New Issue