Opened 13 years ago
Last modified 2 years ago
#19739 new enhancement
Filters to allow comments on draft & trash post_status posts
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 3.3 |
Component: | Comments | Keywords: | has-patch needs-unit-tests |
Focuses: | Cc: |
Description
Attachments (6)
Change History (28)
#1
@
13 years ago
- Keywords has-patch added
My simple solution works for my use case, and seems pretty low impact. How bout it?
#2
@
10 years ago
- Summary changed from Filter to override exit for comments on drafts (comment_on_draft) to Filters to allow comments on draft & trash post_status posts
#3
@
10 years ago
- Keywords needs-docs needs-patch added; dev-feedback has-patch removed
- Milestone changed from Awaiting Review to Future Release
Seems sane. A negative hook name isn't a good idea though because you end up with a double negative to enable the functionality:
add_filter( 'deny_comment_on_trash', '__return_false' );
Better hook names would be allow_comment_on_trash
and allow_comment_on_draft
.
Needs some hook docs too.
This ticket was mentioned in Slack in #core by chriscct7. View the logs.
10 years ago
#9
@
10 years ago
- Keywords needs-testing added
Needs testing:
- When commenting on trashed or draft posts, is the browser redirect and the permalink in the comment notification emails correct? How does the browser redirect for a trashed post work?
- Do draft posts actually list comments on the front end (in the default themes at least)?
#12
@
9 years ago
- Keywords needs-refresh removed
Refreshed the patch and docs for 4.4.0 consideration.
#13
follow-up:
↓ 14
@
9 years ago
- Keywords 2nd-opinion has-patch added
Expanding on my comment above:
- What's the use case for commenting on a trashed post?
- When commenting on trashed or draft posts, is the browser redirect and the permalink in the comment notification emails correct? How does the browser redirect for a trashed post work?
- Do draft posts actually list comments on the front end (in the default themes at least)?
I like the idea of allowing commenting on draft post, but I'm not convinced that allowing the same on trashed posts has any benefit.
#14
in reply to:
↑ 13
@
9 years ago
Replying to johnbillion:
Expanding on my comment above:
- What's the use case for commenting on a trashed post?
I am unsure here, too. However, if we're allowing commenting on drafts, I suspect disallowing it on trash posts could be considered strange.
- When commenting on trashed or draft posts, is the browser redirect and the permalink in the comment notification emails correct? How does the browser redirect for a trashed post work?
Works the same way as normal for drafts. Trashed posts can't be 'seen' from the front-end (you get a 404) but I suspect it could be possible to comment on them if a user has the post open before it is trashed. Interestingly, if you try to submit a comment on a post that is moved into the trash as you're writing your comment, on comment submission, you get a wsod. This suggests to me that we shouldn't allow comments on trashed posts.
- Do draft posts actually list comments on the front end (in the default themes at least)?
Yes.
I like the idea of allowing commenting on draft post, but I'm not convinced that allowing the same on trashed posts has any benefit.
Happy to adjust the patch to only allow for drafts, not trashed posts. Thoughts?
#15
@
9 years ago
My original motivation was to allow a draft to be discussed by authors and editors before publication. My plans didn't include discussion on a trashed post. It's a bit of a stretch, but I suppose a review system could potentially include discussion of whether a trashed post should be permanently deleted or restored. If adding that option introduces complexity though, I would consider just the ability to comment on drafts an enhancement.
#16
@
8 years ago
What's the status of this ticket? I'm working on a project that would benefit from comment capabilities on draft CPTs.
#17
@
8 years ago
@ethanfsmith same here BTW lets "trash" the comments on trash post idea,
We can introduce a new supports for CPT named internal comments with WC order notes like interface, just an idea.
this will be helpful to sites with multiple editors and want to leave a note to each other about current editing post.
#19
@
8 years ago
- Keywords needs-unit-tests added; early removed
Needs test coverage.
Related: #39650.
#21
@
8 years ago
- Keywords needs-testing needs-refresh removed
19739.6.diff is a refresh since [40128], and also removes the final if
statement containing the pre_comment_on_post
hook so it always fires.
Still needs tests.
Added a post id parameter and similar filter for comments on trashed posts.