WordPress.org

Make WordPress Core

Ticket #19858: 19858.diff

File 19858.diff, 896 bytes (added by nacin, 2 years ago)
  • wp-includes/comment.php

     
    19781978        if ( empty( $posts ) || ! $query->is_singular() || ! get_option( 'close_comments_for_old_posts' ) ) 
    19791979                return $posts; 
    19801980 
    1981         $post_types = apply_filters( 'close_comments_for_post_types', array( 'post' ) ); 
     1981        $post_types = apply_filters( 'close_comments_for_post_types', array( 'post', 'attachment' ) ); 
    19821982        if ( ! in_array( $posts[0]->post_type, $post_types ) ) 
    19831983                return $posts; 
    19841984 
     
    20172017 
    20182018        $post = get_post($post_id); 
    20192019 
    2020         $post_types = apply_filters( 'close_comments_for_post_types', array( 'post' ) ); 
     2020        $post_types = apply_filters( 'close_comments_for_post_types', array( 'post', 'attachment' ) ); 
    20212021        if ( ! in_array( $post->post_type, $post_types ) ) 
    20222022                return $open; 
    20232023