Make WordPress Core

Ticket #16090: 16090.2.diff

File 16090.2.diff, 885 bytes (added by nacin, 14 years ago)
  • wp-includes/comment.php

     
    19541954        if ( empty($posts) || !is_singular() || !get_option('close_comments_for_old_posts') )
    19551955                return $posts;
    19561956
     1957        $post_types = apply_filters( 'close_comments_for_post_types', array( 'post' ) );
     1958        if ( ! in_array( $posts[0]->post_type, $post_types )
     1959                return $posts;
     1960
    19571961        $days_old = (int) get_option('close_comments_days_old');
    19581962        if ( !$days_old )
    19591963                return $posts;
     
    19891993
    19901994        $post = get_post($post_id);
    19911995
     1996        $post_types = apply_filters( 'close_comments_for_post_types', array( 'post' ) );
     1997        if ( ! in_array( $post->post_type, $post_types )
     1998                return $open;
     1999
    19922000        if ( time() - strtotime( $post->post_date_gmt ) > ( $days_old * 24 * 60 * 60 ) )
    19932001                return false;
    19942002