Opened 15 years ago
Closed 15 years ago
#17568 closed defect (bug) (fixed)
"Comments are Closed" even when comments are not supported.
| Reported by: | mfields | Owned by: | westi |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.2 |
| Component: | Bundled Theme | Version: | 3.2 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: |
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
@
15 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
@
15 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This patch looks like a good enhancement to me.