Opened 14 years ago
Closed 14 years ago
#17568 closed defect (bug) (fixed)
"Comments are Closed" even when comments are not supported.
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.2 | Priority: | normal |
Severity: | normal | Version: | 3.2 |
Component: | Bundled Theme | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
I have a public custom post_type defined via plugin named "extension" which does not support comments. When I view a single extension in Twenty Eleven it displays a "Comments are Closed" message at the bottom of the page. I think that if post_types do not support comments, the comments template should know this and return early.
Attachments (4)
Change History (15)
#4
@
14 years ago
This patch will disable comments on single attachment pages because comments aren't supported when the attachment post type is registered.
There are two options: 1) Add a check for attachments in the above patch or 2) Add a supports
array at the time the attachment post type is registered.
Personally, I like option 2 because I run a similar function in my themes and have just been registering support for comments on attachments using add_post_type_support()
.
#7
@
14 years ago
Some concerns in IRC bug scrub about the addition complicating the theme.
Attached 17568-simplify.diff which adds the post_type_supports check to be with the existing ! is_page()
check. It also simplifies quite a bit of the logic surrounding the "Comments are closed." note by removing extraneous code and conditional branches.
This patch looks like a good enhancement to me.