Ticket #19858: 19858.2.diff
File 19858.2.diff, 1.5 KB (added by , 13 years ago) |
---|
-
wp-includes/comment.php
1975 1975 if ( empty( $posts ) || ! $query->is_singular() || ! get_option( 'close_comments_for_old_posts' ) ) 1976 1976 return $posts; 1977 1977 1978 $post_types = apply_filters( 'close_comments_for_post_types', array( 'post' ) );1978 $post_types = apply_filters( 'close_comments_for_post_types', array( 'post', 'attachment' ) ); 1979 1979 if ( ! in_array( $posts[0]->post_type, $post_types ) ) 1980 1980 return $posts; 1981 1981 … … 1983 1983 if ( ! $days_old ) 1984 1984 return $posts; 1985 1985 1986 if ( time() - strtotime( $posts[0]->post_date_gmt ) > ( $days_old * 24 * 60 * 60 ) ) { 1986 $post = $posts[0]; 1987 1988 if ( 'inherit' == $posts[0]->post_status ) 1989 $post = get_post( $posts[0]->post_parent ); 1990 1991 if ( time() - strtotime( $post->post_date_gmt ) > ( $days_old * 24 * 60 * 60 ) ) { 1987 1992 $posts[0]->comment_status = 'closed'; 1988 1993 $posts[0]->ping_status = 'closed'; 1989 1994 } … … 2014 2019 2015 2020 $post = get_post($post_id); 2016 2021 2017 $post_types = apply_filters( 'close_comments_for_post_types', array( 'post' ) );2022 $post_types = apply_filters( 'close_comments_for_post_types', array( 'post', 'attachment' ) ); 2018 2023 if ( ! in_array( $post->post_type, $post_types ) ) 2019 2024 return $open; 2020 2025 2026 if ( 'inherit' == get_post_status( $post_id ) ) 2027 $post = get_post( $post->post_parent ); 2028 2021 2029 if ( time() - strtotime( $post->post_date_gmt ) > ( $days_old * 24 * 60 * 60 ) ) 2022 2030 return false; 2023 2031