Don't show comments template if post is empty
git-svn-id: https://develop.svn.wordpress.org/trunk@11839 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f4f70a6479
commit
1a2506c493
@ -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
Block a user