WordPress.org

Make WordPress Core

Ticket #17568: 17568.return-early-from-comments.diff

File 17568.return-early-from-comments.diff, 658 bytes (added by mfields, 4 years ago)
  • wp-content/themes/twentyeleven/comments.php

     
    1212 * @since Twenty Eleven 1.0 
    1313 */ 
    1414?> 
     15 
     16<?php 
     17/* Return early if post_type does not support comments. */ 
     18if ( ! post_type_supports( get_post_type(), 'comments' ) ) { 
     19        return; 
     20} 
     21?> 
     22 
    1523        <div id="comments"> 
    1624        <?php if ( post_password_required() ) : ?> 
    1725                <p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyeleven' ); ?></p>