#12991 closed enhancement (fixed)
Allow setting default_comment_status specifically for Pages (or for any post type)
Reported by: | demetris | Owned by: | messenlehner |
---|---|---|---|
Milestone: | 4.3 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Comments | Keywords: | has-patch |
Focuses: | Cc: |
Description
Now that the default theme has comments_template
in Pages too, I have been thinking that maybe we should offer a way of setting default_comment_status
specifically for Pages (as distinguished from Posts).
Why?
Say that I select Twenty Ten as my theme. I leave the global option for comments ON, because, like most people, I want comments on my Posts. However, like most people, I do not want comments on Pages, or I want comments only on a few selected Pages. So, every time I make a new Page, I have to untick the checkbox on the Edit screen, in order to override the global setting. That’s not convenient!
I think we need to do something about that:
Either we leave Twenty Ten as is and change something at the level of post type registration, or we change something in Twenty Ten.
(I have no idea what would be a satisfactory way to deal with this at the theme level. Sandbox, for instance, displayed the form on Pages only if there was a certain custom field with a certain value, which may seem very unfriendly at first sight, but I find it is much friendlier than what we have now in Twenty Ten.)
Attachments (2)
Change History (33)
#2
@
15 years ago
- Cc mikeschinkel@… added
@demetris: I agree, the default should be comments on Post and no comments on Pages or any other custom post types. The user should be able to turn on comments for non-Posts, either on a per-post or a global basis but by default only Posts (post_type="post") should have comments. (Note: Post is post_type="post" and post is any post_type.)
IMO, anyway.
#3
@
14 years ago
IMHO, this should be a great addition under Settings > Discussion >
Discussion Settings.
Under Default article settings add another checkbox "Allow people to post comments on new articles Page" or something like that.
#8
@
14 years ago
- Keywords ux-feedback added
I think we should revert these and revisit this in 3.1. We need to properly handle an upgrade, for one, also, if we're going to do this, we should consider providing support for custom post types. I know it was committed during the code sprint, but I'm also not sure if this got any ux feedback.
#9
@
14 years ago
There are a couple more issues I’ve noticed after the latest patch:
- The explanatory sentence is repeated twice. We only need it once.
- The option appears even when it does nothing, i.e., even when the active theme does not support Page comments.
Revisiting all this in v3.1 sounds a reasonable idea at this stage of the release cycle. On the other hand, this is something I would like to see addressed sooner than later, provided we want Twenty Ten to be a theme people will want to use, and will be happy using.
#10
follow-up:
↓ 11
@
14 years ago
- Cc john.wp@… added
I agree that a more comprehensive solution should be looked at rather than just bolting on another checkbox
#11
in reply to:
↑ 10
;
follow-up:
↓ 12
@
14 years ago
Replying to johnonolan:
I agree that a more comprehensive solution should be looked at rather than just bolting on another checkbox
“bolting on another checkbox”, either at the theme level or at the core level, will be part of any comprehensive solution in any case, since this option must be somehow exposed in the UI.
#12
in reply to:
↑ 11
@
14 years ago
Replying to demetris:
Replying to johnonolan:
I agree that a more comprehensive solution should be looked at rather than just bolting on another checkbox
“bolting on another checkbox”, either at the theme level or at the core level, will be part of any comprehensive solution in any case, since this option must be somehow exposed in the UI.
Indeed, but where and what exactly the checkbox does depend on a final functionality spec
#15
follow-ups:
↓ 16
↓ 20
@
14 years ago
Another problem with the current implementation in WP / Twenty Ten, that I failed to mention before:
If you switch to Twenty Ten from another theme, then comments are turned automatically on for all existing Pages.
#16
in reply to:
↑ 15
@
14 years ago
Replying to demetris:
If you switch to Twenty Ten from another theme, then comments are turned automatically on for all existing Pages.
Obviously the Discussion setting for Allow Comments / pingback for that particular Page is ticked. Need to turn it off individually. That's how it suppose to work.
#17
follow-up:
↓ 18
@
14 years ago
@zeo:
That’s exactly the problem:
That, if you want to keep the previous behaviour, you have to go to each one of your Pages and untick an option.
#18
in reply to:
↑ 17
@
14 years ago
Replying to demetris:
@zeo:
That’s exactly the problem:
That, if you want to keep the previous behaviour, you have to go to each one of your Pages and untick an option.
Or use bulk edit and have it done in 10 seconds.
#19
@
14 years ago
@nacin:
Certainly. Bulk edit reduces the inconvenience in this particular case, but bulk edit is not what everyone will think of when they see comment forms on their Pages, and, in any case, that’s not the only issue in the current implementation.
#20
in reply to:
↑ 15
@
14 years ago
Replying to demetris:
Another problem with the current implementation in WP / Twenty Ten, that I failed to mention before:
If you switch to Twenty Ten from another theme, then comments are turned automatically on for all existing Pages.
This is not a problem with WP / TwentyTen. This is a problem with your previous theme for not properly supporting comments on pages. Comments are not turned on automatically. You just happened to switch to a theme that does things the correct way.
#22
follow-up:
↓ 27
@
13 years ago
Is this ticket going anywhere, or is it DOA? I would be happy to work on it, if the underlying intent is still acceptable.
I think the correct approach would be to replace default_comment_status
with default_comment_status_post
, default_comment_status_page
, and default_comment_status_attachment
(which establishes a convention of default_comment_status_$posttype
for CPTs).
Also, the Default article settings text needs to be changed. As far as I know, Posts aren't referred to as Articles anywhere else?
Regarding the UI, I would propose renaming the section from "Default article settings" to "Default comment status", and then provide grouped checkboxes for the following:
Allow people to post comments on: [ ] Posts [ ] Pages [ ] Attachments Allow link notifications (pingbacks/trackbacks) on: [ ] Posts [ ] Pages [ ] Attachments Attempt to notify blogs linked to from: [ ] Posts [ ] Pages
...but this would need to be extensible for registered CPTs. (Perhaps through a filter?)
Related: when will the core options-$section.php
files be implementing the Settings API? If/when that happens, then custom post type support becomes nothing more than a matter of adding an add_settings_field()
call along with the register_post_type()
call.
#23
@
13 years ago
- Keywords ux-feedback removed
@chipbennett: I think your grouped checkboxes proposal looks great. Would love to see that improvement. Not sure if existing patch needs refresh or if it needs to be scrapped and a new one started.
#24
follow-up:
↓ 25
@
13 years ago
@jane - looks like probably a new patch will be in order.
Do you think I should include all post types (i.e. to include any user-registered post types), or just Posts and Pages (and Attachments)?
#25
in reply to:
↑ 24
@
13 years ago
- Cc xoodrew@… added
Replying to chipbennett:
Do you think I should include all post types (i.e. to include any user-registered post types), or just Posts and Pages (and Attachments)?
IANAJ but it would be nice to have support for all post types here, assuming said post types have comments enabled in their supports arrays.
#26
@
12 years ago
For all people stumbling over this ticket (that hasn't made progress for a while), here's a temporary solution written by a user on WordPress StackExchange.
function wpse48145_unchecked_page_discussion () { if( 'page' == $_REQUEST[ 'post_type' ] ) { add_filter( 'pre_option_default_comment_status', 'wpse48145_unchecked_page_discussion_filter' ); // & if you want... add_filter( 'pre_option_default_ping_status', 'wpse48145_unchecked_page_discussion_filter' ); } } add_action( 'load-post-new.php', 'wpse48145_unchecked_page_discussion' ); function wpse48145_unchecked_page_discussion_filter ( $val ) { return 'closed'; }
#27
in reply to:
↑ 22
@
12 years ago
Replying to chipbennett:
Also, the Default article settings text needs to be changed. As far as I know, Posts aren't referred to as Articles anywhere else?
Related: #22579
#30
@
9 years ago
- Resolution set to fixed
- Status changed from assigned to closed
Addressed in #31168, and documented here: https://make.wordpress.org/core/2015/07/06/comments-are-now-turned-off-on-pages-by-default/
The previous Default theme just did things wrong. It should've always shown the comments form by default on pages. Twenty Ten just fixes a bug. Changing something in the theme should not be an option at all. The Sandbox theme just adds another level of complexity to something already built in.
I'm impartial to allowing a default for other post types, but a big -1 to changing how this is handled in Twenty Ten.