Ticket #16090: 16090.3.diff
File 16090.3.diff, 831 bytes (added by , 14 years ago) |
---|
-
wp-includes/comment.php
1965 1965 if ( empty($posts) || !is_singular() || !get_option('close_comments_for_old_posts') ) 1966 1966 return $posts; 1967 1967 1968 $post_types = apply_filters( 'close_comments_for_post_types', array( 'post' ) ); 1969 if ( ! in_array( $posts[0]->post_type, $post_types ) ) 1970 return $posts; 1971 1968 1972 $days_old = (int) get_option('close_comments_days_old'); 1969 1973 if ( !$days_old ) 1970 1974 return $posts; … … 2000 2004 2001 2005 $post = get_post($post_id); 2002 2006 2007 $post_types = apply_filters( 'close_comments_for_post_types', array( 'post' ) ); 2008 if ( ! in_array( $post->post_type, $post_types ) ) 2009 return $open; 2010 2003 2011 if ( time() - strtotime( $post->post_date_gmt ) > ( $days_old * 24 * 60 * 60 ) ) 2004 2012 return false; 2005 2013