Ticket #16090: 16090.2.diff
File 16090.2.diff, 885 bytes (added by , 14 years ago) |
---|
-
wp-includes/comment.php
1954 1954 if ( empty($posts) || !is_singular() || !get_option('close_comments_for_old_posts') ) 1955 1955 return $posts; 1956 1956 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 1957 1961 $days_old = (int) get_option('close_comments_days_old'); 1958 1962 if ( !$days_old ) 1959 1963 return $posts; … … 1989 1993 1990 1994 $post = get_post($post_id); 1991 1995 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 1992 2000 if ( time() - strtotime( $post->post_date_gmt ) > ( $days_old * 24 * 60 * 60 ) ) 1993 2001 return false; 1994 2002