Make WordPress Core

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

File 17568.return-early-from-comments-2.diff, 1.0 KB (added by mfields, 14 years ago)

Builds off first patch. Adds comments support for the 'attachment' post_type.

  • wp-includes/post.php

     
    5555                'rewrite' => false,
    5656                'query_var' => false,
    5757                'show_in_nav_menus' => false,
     58                'supports' => array( 'comments' ),
    5859        ) );
    5960
    6061        register_post_type( 'revision', array(
  • 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>