﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
19929	Automatically close comments after X days: Doesn't work with custom post types	ndoherty13		"In the discussion settings you can set comments to close after X days. This works for regular posts, but not for custom post types. The comments on the latter stay open regardless.

Issue experienced on two separate WordPress installations, one of which had all plugins disabled and was using the default TwentyEleven theme.

To recreate the issue follow these steps:

'''1.''' Register a custom post type in the theme's functions.php file using the following code...

{{{
add_action( 'init', 'create_post_type_1' );
function create_post_type_1() {
	register_post_type( 'book_reviews',
		array(
			'labels' => array(
				'name' => __( 'Book Reviews' ),
				'singular_name' => __( 'Book Review' ),
				'all_items' => __( 'All Reviews' ),
				'add_new_item' => __( 'Add New Book Review' ),
				'edit_item' => __( 'Edit Book Review' ),
				'view_item' => __( 'View Review' )
			),
			'public' => true,
			'has_archive' => true,
			'rewrite' => array('slug' => 'book-reviews'),
			'supports' => array(
				'title',
				'editor',
				'author',
				'thumbnail',
				'excerpt',
				'trackbacks',
				'custom-fields',
				'comments',
				'revisions'
			),
        	'taxonomies' => array('post_tag')
		)
	);
}
}}}

'''2.''' In your site's discussion settings, set comments to automatically close after 1 day.

'''3.''' Publish a regular blog post and a custom post type (CPT) post.

'''4.''' Check back in 24 hours and you'll find that the comments on the regular post are now closed, while the comments on the CPT post remain open.
"	defect (bug)	closed	normal		Comments	3.3.1	normal	invalid		
